mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-11 13:59:13 +00:00
Improve TimelineAccessibilityModifier
This commit is contained in:
parent
f7f3404312
commit
30e8753663
@ -24,8 +24,18 @@ private struct TimelineAccessibilityModifier: ViewModifier {
|
||||
switch timelineItem {
|
||||
case is PollRoomTimelineItem, is VoiceMessageRoomTimelineItem:
|
||||
content
|
||||
case let timelineItem as EventBasedTimelineItemProtocol:
|
||||
content
|
||||
.accessibilityRepresentation {
|
||||
VStack {
|
||||
Text(timelineItem.sender.displayName ?? timelineItem.sender.id)
|
||||
content
|
||||
}
|
||||
}
|
||||
.accessibilityElement(children: .combine)
|
||||
default:
|
||||
content.accessibilityElement(children: .combine)
|
||||
content
|
||||
.accessibilityElement(children: .combine)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -87,6 +87,7 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
.lineLimit(1)
|
||||
.padding(.vertical, senderNameVerticalPadding)
|
||||
}
|
||||
// sender info are read inside the `TimelineAccessibilityModifier`
|
||||
.accessibilityHidden(true)
|
||||
.onTapGesture {
|
||||
context.send(viewAction: .tappedOnUser(userID: timelineItem.sender.id))
|
||||
@ -99,14 +100,6 @@ struct TimelineItemBubbledStylerView<Content: View>: View {
|
||||
// Figma overlaps reactions by 3
|
||||
VStack(alignment: alignment, spacing: -3) {
|
||||
messageBubble
|
||||
.accessibilityRepresentation {
|
||||
VStack(spacing: 0) {
|
||||
Text(timelineItem.sender.displayName ?? timelineItem.sender.id)
|
||||
// Workaround: fixes VoiceOver frames offset when children accessibility element aren't combined
|
||||
.frame(height: 0)
|
||||
messageBubble
|
||||
}
|
||||
}
|
||||
.timelineAccessibility(timelineItem)
|
||||
|
||||
if !timelineItem.properties.reactions.isEmpty {
|
||||
|
@ -114,6 +114,8 @@ struct TimelineItemPlainStylerView<Content: View>: View {
|
||||
.font(.compound.bodyXS)
|
||||
}
|
||||
.padding(.top, 16)
|
||||
// sender info are read inside the `TimelineAccessibilityModifier`
|
||||
.accessibilityHidden(true)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -54,6 +54,7 @@ struct PollRoomTimelineView: View {
|
||||
Image(asset.name)
|
||||
.resizable()
|
||||
.frame(width: iconSize, height: iconSize)
|
||||
.accessibilityHidden(true)
|
||||
|
||||
Text(poll.question)
|
||||
.multilineTextAlignment(.leading)
|
||||
|
Loading…
x
Reference in New Issue
Block a user