Skip to content

Commit 4237063

Browse files
authored
Merge pull request #1246 from wordpress-mobile/fix/more-button-accessibility
Improve “More” button accessibility
2 parents c376a3a + 6e64f0d commit 4237063

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

Aztec/Classes/GUI/FormatBar/FormatBar.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ open class FormatBar: UIView {
110110
let item = FormatBarItem(image: UIImage(), identifier: nil)
111111
self.configureStylesFor(item)
112112

113+
item.accessibilityLabel = NSLocalizedString("More", comment: "Accessibility label for the More button on formatting toolbar.")
113114
item.addTarget(self, action: #selector(handleToggleButtonAction), for: .touchUpInside)
114115
item.addTarget(self, action: #selector(handleButtonTouch), for: .touchDown)
115116

@@ -440,6 +441,7 @@ open class FormatBar: UIView {
440441
rotateOverflowToggleItem(.vertical, animated: false)
441442
}
442443

444+
updateOverflowToggleItemAccessibilityTraits(expanded: overflowVisible)
443445
updateOverflowToggleItemVisibility()
444446
}
445447

@@ -527,6 +529,7 @@ open class FormatBar: UIView {
527529
formatter?.formatBar(self, didChangeOverflowState: (shouldExpand) ? .visible : .hidden)
528530

529531
updateOverflowToggleItemRTLLayout(expand: shouldExpand, animated: true)
532+
updateOverflowToggleItemAccessibilityTraits(expanded: shouldExpand)
530533
}
531534

532535
private func setOverflowItemsVisible(_ visible: Bool, animated: Bool = true) {
@@ -859,6 +862,16 @@ extension FormatBar: UIScrollViewDelegate {
859862
}
860863
}
861864

865+
// MARK: - Accessibility
866+
867+
private extension FormatBar {
868+
func updateOverflowToggleItemAccessibilityTraits(expanded: Bool) {
869+
// We _could_ use overflowToggleItem.isSelected instead of modifying the traits. However,
870+
// that would highlight the button with another color, which we don't need.
871+
overflowToggleItem.accessibilityTraits = expanded ? [.button, .selected] : [.button]
872+
}
873+
}
874+
862875
// MARK: - Constants
863876
extension FormatBar {
864877
struct Constants {

WordPress-Aztec-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Aztec-iOS'
11-
s.version = '1.14.1'
11+
s.version = '1.15.0-beta.1'
1212
s.summary = 'The native HTML Editor.'
1313

1414
# This description is used to generate tags and improve search results.

WordPress-Editor-iOS.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Pod::Spec.new do |s|
1010
s.name = 'WordPress-Editor-iOS'
11-
s.version = '1.14.1'
11+
s.version = '1.15.0-beta.1'
1212
s.summary = 'The WordPress HTML Editor.'
1313

1414
# This description is used to generate tags and improve search results.

0 commit comments

Comments
 (0)