added error state in the accessibilityLabel

Signed-off-by: Matt Bruce <matt.bruce@verizon.com>
This commit is contained in:
Matt Bruce 2024-04-29 09:52:39 -05:00
parent a04f9a14df
commit 80233b6797
3 changed files with 3 additions and 3 deletions

View File

@ -123,6 +123,7 @@ open class SelectorBase: Control, SelectorControlable {
/// Used to update any Accessibility properties.ß /// Used to update any Accessibility properties.ß
open override func updateAccessibility() { open override func updateAccessibility() {
super.updateAccessibility() super.updateAccessibility()
accessibilityLabel = "\(Self.self)\(showError ? ", error" : "")"
} }
/// This will change the state of the Selector and execute the actionBlock if provided. /// This will change the state of the Selector and execute the actionBlock if provided.

View File

@ -190,7 +190,7 @@ open class SelectorItemBase<Selector: SelectorControlable>: Control, Errorable,
/// Used to update any Accessibility properties. /// Used to update any Accessibility properties.
open override func updateAccessibility() { open override func updateAccessibility() {
super.updateAccessibility() super.updateAccessibility()
setAccessibilityLabel(for: [label, childLabel, errorLabel]) setAccessibilityLabel(for: [selectorView, label, childLabel, errorLabel])
} }
/// Resets to default settings. /// Resets to default settings.

View File

@ -42,7 +42,6 @@ open class Checkbox: SelectorBase {
/// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations. /// Called once when a view is initialized and is used to Setup additional UI or other constants and configurations.
open override func setup() { open override func setup() {
super.setup() super.setup()
accessibilityLabel = "Checkbox"
backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .selected) backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: .selected)
backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: [.selected, .highlighted]) backgroundColorConfiguration.setSurfaceColors(VDSColor.elementsPrimaryOnlight, VDSColor.elementsPrimaryOndark, forState: [.selected, .highlighted])
@ -71,7 +70,7 @@ open class Checkbox: SelectorBase {
isSelected.toggle() isSelected.toggle()
sendActions(for: .valueChanged) sendActions(for: .valueChanged)
} }
open override func layoutSubviews() { open override func layoutSubviews() {
super.layoutSubviews() super.layoutSubviews()