diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift b/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift index cffbb916..f23fd337 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/Checkbox.swift @@ -157,9 +157,9 @@ import MVMCore override public init(frame: CGRect) { super.init(frame: frame) - accessibilityTraits = .button isAccessibilityElement = true accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "checkbox_action_hint") + accessibilityTraits = .button updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift index 43750513..371d3f7a 100644 --- a/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift +++ b/MVMCoreUI/Atomic/Atoms/Selectors/RadioButton.swift @@ -147,8 +147,8 @@ import UIKit addTarget(self, action: #selector(tapAction), for: .touchUpInside) isAccessibilityElement = true - accessibilityTraits = .button accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "radio_action_hint") + accessibilityTraits = .button updateAccessibilityLabel() } diff --git a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift index 9dc4a0bd..69048e74 100644 --- a/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift +++ b/MVMCoreUI/Atomic/Atoms/Views/CarouselIndicator/BarsIndicatorView.swift @@ -115,12 +115,12 @@ open class BarsIndicatorView: CarouselIndicator { for i in 0.. (Bool) super.setupView() isAccessibilityElement = true - accessibilityTraits = .button accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccToggleHint") accessibilityLabel = MVMCoreUIUtility.hardcodedString(withKey: "Toggle_buttonlabel") - + accessibilityTraits = .button + heightConstraint = heightAnchor.constraint(equalToConstant: Self.containerSize.height) heightConstraint?.isActive = true diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift index d8885875..986ee73b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonMedium.swift @@ -58,8 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint + accessibilityTraits = button.accessibilityTraits } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift index b2e4b25c..cd43215b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/Device/ListDeviceComplexButtonSmall.swift @@ -58,8 +58,8 @@ import Foundation addMolecule(stack) stack.restack() verticalStack.restack() - accessibilityTraits = button.accessibilityTraits accessibilityHint = button.accessibilityHint + accessibilityTraits = button.accessibilityTraits } //-------------------------------------------------- diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift index 65d1bd63..ff625e8b 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxAllTextAndLinks.swift @@ -49,8 +49,8 @@ import Foundation addMolecule(stack) stack.restack() - accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint + accessibilityTraits = checkbox.accessibilityTraits // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift index 9d58b625..69ad2156 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableCheckboxBodyText.swift @@ -49,8 +49,8 @@ import Foundation addMolecule(stack) stack.restack() isAccessibilityElement = true - accessibilityTraits = checkbox.accessibilityTraits accessibilityHint = checkbox.accessibilityHint + accessibilityTraits = checkbox.accessibilityTraits // Update accessibility label on checkbox state change. observation = observe(\.checkbox.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift index 9d036d4f..e14e91e2 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonAndPaymentMethod.swift @@ -50,9 +50,9 @@ import UIKit eyebrowHeadlineBodyLink.body.textColor = .mvmOrangeAA eyebrowHeadlineBodyLink.headline.setFontStyle(.BoldBodySmall) - accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint - + accessibilityTraits = radioButton.accessibilityTraits + // Update accessibility label on radio button state change. observation = observe(\.radioButton.isSelected, options: [.new]) { [weak self] _, _ in self?.updateAccessibilityLabel() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift index c6349aa1..a30f3f9e 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/LeftVariable/ListLeftVariableRadioButtonBodyText.swift @@ -47,8 +47,8 @@ open class ListLeftVariableRadioButtonBodyText: TableViewCell { // Make the whole cell focusable. isAccessibilityElement = true - accessibilityTraits = radioButton.accessibilityTraits accessibilityHint = radioButton.accessibilityHint + accessibilityTraits = radioButton.accessibilityTraits updateAccessibilityLabel() // Update accessibility label on radio button state change. diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift index 184abebc..6e5a7245 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/List/OneColumn/ListOneColumnFullWidthTextAllTextAndLinks.swift @@ -92,11 +92,18 @@ import Foundation return message.count > 0 ? message : nil } + // Ensures voice over does not read "selected" after user triggers action on cell. + override public var accessibilityTraits: UIAccessibilityTraits { + get { + return (accessoryView != nil) ? .button : .none + } + set {} + } + func updateAccessibilityLabel() { let linkShowing = link.titleLabel?.text?.count ?? 0 > 0 isAccessibilityElement = !linkShowing - accessibilityTraits = (accessoryView != nil) ? .button : .none if !linkShowing { // Make whole cell focusable if no link. accessibilityLabel = getAccessibilityMessage() diff --git a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift index 474907dd..5926951f 100644 --- a/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift +++ b/MVMCoreUI/Atomic/Molecules/VerticalCombinationViews/ThreeHeadlineBodyLink.swift @@ -73,8 +73,8 @@ open class ThreeHeadlineBodyLink: View { bottomAnchor.constraint(equalTo: link.bottomAnchor).isActive = true isAccessibilityElement = true - accessibilityTraits = link.accessibilityTraits accessibilityHint = link.accessibilityHint + accessibilityTraits = link.accessibilityTraits updateAccessibilityLabel() } diff --git a/MVMCoreUI/BaseClasses/TableViewCell.swift b/MVMCoreUI/BaseClasses/TableViewCell.swift index caaeec85..300150e8 100644 --- a/MVMCoreUI/BaseClasses/TableViewCell.swift +++ b/MVMCoreUI/BaseClasses/TableViewCell.swift @@ -205,8 +205,8 @@ import UIKit let caret = CaretView(lineWidth: 1) caret.translatesAutoresizingMaskIntoConstraints = true caret.isAccessibilityElement = true - caret.accessibilityTraits = .button caret.accessibilityHint = MVMCoreUIUtility.hardcodedString(withKey: "AccTabHint") + caret.accessibilityTraits = .button caret.size = .small(.vertical) if let size = caret.size?.dimensions() { caret.frame = CGRect(origin: CGPoint.zero, size: size)