mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 03:48:27 +00:00
Read the number of selected messages to VoiceOver
The count was only on the forward button at the bottom, so VoiceOver users had to go and find it after every tap. While selecting, each selectable message now starts its label with "N messages selected". The label changes on every toggle, so VoiceOver reads the new count followed by the message, as in other messaging apps.
This commit is contained in:
+6
-2
@@ -13,7 +13,7 @@ enum TimelineItemAccessibilityMessageSelection {
|
||||
/// No selection is active, the item offers its regular message actions.
|
||||
case none
|
||||
/// A selection is active, the item acts as a toggle when it can be selected.
|
||||
case selecting(isSelected: Bool)
|
||||
case selecting(isSelected: Bool, selectedCount: Int)
|
||||
}
|
||||
|
||||
private struct TimelineItemAccessibilityModifier: ViewModifier {
|
||||
@@ -76,9 +76,13 @@ private struct TimelineItemAccessibilityModifier: ViewModifier {
|
||||
action()
|
||||
}
|
||||
}
|
||||
case .selecting(let isSelected):
|
||||
case .selecting(let isSelected, let selectedCount):
|
||||
if let item = timelineItem as? EventBasedTimelineItemProtocol, item.isForwardable {
|
||||
view
|
||||
.accessibilityLabel { label in
|
||||
Text(L10n.screenRoomSelectionCount(selectedCount))
|
||||
label
|
||||
}
|
||||
.accessibilityAddTraits(isSelected ? [.isButton, .isSelected] : .isButton)
|
||||
.accessibilityAction(.default, action)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user