mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
Give the pinned items banner an explicit accessibility label and value
The view-all button drops its visible text to an empty string while loading, relying only on a ProgressView for feedback, so VoiceOver users focusing it while it loads hear an unlabelled button. The main pinned-item button also has no accessibility label/value describing which pinned item is shown or its position, since children: .contain leaves that to implicit merging of its sub-views. Set an explicit label on the view-all button so it always announces its title, and give the main button an explicit label (the pinned message) and value (its position, reusing the existing bannerIndicatorDescription/ screenRoomPinnedBannerIndicator strings) instead of relying on container merging.
This commit is contained in:
+5
-2
@@ -40,9 +40,11 @@ struct PinnedItemsBannerView: View {
|
||||
}
|
||||
}
|
||||
.disabled(state.isLoading)
|
||||
.accessibilityElement(children: .contain)
|
||||
.accessibilityElement(children: .ignore)
|
||||
.accessibilityLabel(Text(state.displayedMessage))
|
||||
.accessibilityValue(state.count > 1 ? Text(state.bannerIndicatorDescription) : Text(""))
|
||||
}
|
||||
|
||||
|
||||
private var viewAllButton: some View {
|
||||
Button { onViewAllButtonTap() } label: {
|
||||
Text(state.isLoading ? "" : L10n.screenRoomPinnedBannerViewAllButtonTitle)
|
||||
@@ -58,6 +60,7 @@ struct PinnedItemsBannerView: View {
|
||||
.padding(.vertical, 5)
|
||||
}
|
||||
.disabled(state.isLoading)
|
||||
.accessibilityLabel(L10n.screenRoomPinnedBannerViewAllButtonTitle)
|
||||
}
|
||||
|
||||
private var content: some View {
|
||||
|
||||
Reference in New Issue
Block a user