Fix accessibility in chat history items.
This commit is contained in:
parent
cb358fd98b
commit
bec6d3cd09
@ -230,7 +230,8 @@ extension CVComponentBase: CVNode {
|
||||
|
||||
var isTextOnlyMessage: Bool { messageCellType == .textOnlyMessage }
|
||||
|
||||
func accessibilityLabel(description descriptionParam: String?) -> String {
|
||||
func accessibilityLabel(description descriptionParam: String?,
|
||||
ignoreMissingSenderName: Bool = false) -> String {
|
||||
let description = { () -> String in
|
||||
if let description = descriptionParam,
|
||||
!description.isEmpty {
|
||||
@ -241,6 +242,8 @@ extension CVComponentBase: CVNode {
|
||||
if let authorName = itemViewState.accessibilityAuthorName,
|
||||
!authorName.isEmpty {
|
||||
return "\(authorName) \(description)"
|
||||
} else if ignoreMissingSenderName {
|
||||
return description
|
||||
} else {
|
||||
owsFailDebug("Missing sender name.")
|
||||
return description
|
||||
|
||||
@ -99,7 +99,8 @@ public class CVComponentSystemMessage: CVComponentBase, CVRootComponent {
|
||||
selectionView.isHiddenInStackView = !isShowingSelectionUI
|
||||
|
||||
titleLabelConfig.applyForRendering(label: titleLabel)
|
||||
titleLabel.accessibilityLabel = accessibilityLabel(description: titleLabelConfig.stringValue)
|
||||
titleLabel.accessibilityLabel = accessibilityLabel(description: titleLabelConfig.stringValue,
|
||||
ignoreMissingSenderName: true)
|
||||
|
||||
let isReusing = componentView.rootView.superview != nil
|
||||
if !isReusing {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user