CXTDT-556996 RadioboxGroup – Voice over does not render the group position for the radio box group.
implemented groupable to ensure accessibilityValue is kept to help explain groups Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
parent
91de90354d
commit
9690f152ef
@ -39,7 +39,7 @@ extension SelectorGroupSingleSelect {
|
||||
}
|
||||
|
||||
/// Base Class used for any Grouped Form Control of a Selector Type.
|
||||
open class SelectorGroupBase<SelectorItemType: Control>: Control, SelectorGroup, Changeable {
|
||||
open class SelectorGroupBase<SelectorItemType: Groupable>: Control, SelectorGroup, Changeable {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Private Properties
|
||||
|
||||
@ -11,7 +11,7 @@ import Combine
|
||||
import VDSTokens
|
||||
|
||||
/// Base Class used to build out a SelectorControlable control.
|
||||
open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable, Changeable {
|
||||
open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable, Changeable, Groupable {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -145,6 +145,8 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
|
||||
open var hiddenValue: AnyHashable? { didSet { setNeedsUpdate() } }
|
||||
|
||||
open var accessibilityValueText: String?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Overrides
|
||||
//--------------------------------------------------
|
||||
@ -193,6 +195,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
setAccessibilityLabel(for: [selectorView, label, childLabel, errorLabel])
|
||||
accessibilityValue = accessibilityValueText
|
||||
}
|
||||
|
||||
/// Resets to default settings.
|
||||
|
||||
@ -48,7 +48,7 @@ open class CheckboxGroup: SelectorGroupBase<CheckboxItem>, SelectorGroupMultiSel
|
||||
$0.inputId = model.inputId
|
||||
$0.hiddenValue = model.value
|
||||
$0.accessibilityLabel = model.accessibileText
|
||||
$0.accessibilityValue = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.accessibilityValueText = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.labelText = model.labelText
|
||||
$0.labelTextAttributes = model.labelTextAttributes
|
||||
$0.childText = model.childText
|
||||
|
||||
@ -56,6 +56,7 @@ open class RadioBoxGroup: SelectorGroupBase<RadioBoxItem>, SelectorGroupSingleSe
|
||||
$0.isSelected = model.selected
|
||||
$0.strikethrough = model.strikethrough
|
||||
$0.strikethroughAccessibilityText = model.strikethroughAccessibileText
|
||||
$0.accessibilityValueText = "item \(index+1) of \(selectorModels.count)"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ import VDSTokens
|
||||
/// Radio boxes are single-select components through which a customer indicates a choice
|
||||
/// that are used within a ``RadioBoxGroup``.
|
||||
@objc(VDSRadioBoxItem)
|
||||
open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
open class RadioBoxItem: Control, Changeable, FormFieldable, Groupable {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -130,7 +130,9 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
open var value: AnyHashable? { hiddenValue }
|
||||
|
||||
open var hiddenValue: AnyHashable? { didSet { setNeedsUpdate() } }
|
||||
|
||||
|
||||
open var accessibilityValueText: String?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Configuration Properties
|
||||
//--------------------------------------------------
|
||||
@ -241,7 +243,15 @@ open class RadioBoxItem: Control, Changeable, FormFieldable {
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
setAccessibilityLabel(for: [textLabel, subTextLabel, subTextRightLabel])
|
||||
accessibilityValue = strikethrough ? strikethroughAccessibilityText : nil
|
||||
if let accessibilityValueText {
|
||||
accessibilityValue = strikethrough
|
||||
? "\(strikethroughAccessibilityText), \(accessibilityValueText)"
|
||||
: accessibilityValueText
|
||||
} else {
|
||||
accessibilityValue = strikethrough
|
||||
? "\(strikethroughAccessibilityText)"
|
||||
: accessibilityValueText
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------
|
||||
|
||||
@ -47,7 +47,7 @@ open class RadioButtonGroup: SelectorGroupBase<RadioButtonItem>, SelectorGroupSi
|
||||
$0.inputId = model.inputId
|
||||
$0.hiddenValue = model.value
|
||||
$0.accessibilityLabel = model.accessibileText
|
||||
$0.accessibilityValue = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.accessibilityValueText = "item \(index+1) of \(selectorModels.count)"
|
||||
$0.labelText = model.labelText
|
||||
$0.labelTextAttributes = model.labelTextAttributes
|
||||
$0.childText = model.childText
|
||||
|
||||
@ -13,7 +13,7 @@ import Combine
|
||||
extension Tabs {
|
||||
|
||||
@objc(VDSTab)
|
||||
open class Tab: Control {
|
||||
open class Tab: Control, Groupable {
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Initializers
|
||||
@ -89,6 +89,8 @@ extension Tabs {
|
||||
|
||||
open override var shouldHighlight: Bool { false }
|
||||
|
||||
open var accessibilityValueText: String?
|
||||
|
||||
//--------------------------------------------------
|
||||
// MARK: - Configuration
|
||||
//--------------------------------------------------
|
||||
@ -178,6 +180,7 @@ extension Tabs {
|
||||
open override func updateAccessibility() {
|
||||
super.updateAccessibility()
|
||||
accessibilityLabel = text
|
||||
accessibilityValue = accessibilityValueText
|
||||
}
|
||||
|
||||
open override func layoutSubviews() {
|
||||
|
||||
@ -303,7 +303,7 @@ open class Tabs: View {
|
||||
tabItem.orientation = orientation
|
||||
tabItem.surface = surface
|
||||
tabItem.indicatorPosition = indicatorPosition
|
||||
tabItem.accessibilityValue = "\(index+1) of \(tabViews.count) Tabs"
|
||||
tabItem.accessibilityValueText = "\(index+1) of \(tabViews.count) Tabs"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user