fix accessibility label in notifications (#4305)
* fix accessibility label in notifications * add accessibility options to expand post * inherit from outside, but always include `activate` * include option to disable label/hint on previewable avatar * fix hidden elements still being read on voiceover * make it work for followers too * extract variable * fix hint * update wording elsewhere
This commit is contained in:
parent
b51640fbc0
commit
708a80e7a7
3 changed files with 93 additions and 49 deletions
|
|
@ -64,6 +64,8 @@ export const Link = memo(function Link({
|
|||
anchorNoUnderline,
|
||||
navigationAction,
|
||||
onBeforePress,
|
||||
accessibilityActions,
|
||||
onAccessibilityAction,
|
||||
...props
|
||||
}: Props) {
|
||||
const t = useTheme()
|
||||
|
|
@ -89,6 +91,11 @@ export const Link = memo(function Link({
|
|||
[closeModal, navigation, navigationAction, href, openLink, onBeforePress],
|
||||
)
|
||||
|
||||
const accessibilityActionsWithActivate = [
|
||||
...(accessibilityActions || []),
|
||||
{name: 'activate', label: title},
|
||||
]
|
||||
|
||||
if (noFeedback) {
|
||||
return (
|
||||
<WebAuxClickWrapper>
|
||||
|
|
@ -97,6 +104,14 @@ export const Link = memo(function Link({
|
|||
onPress={onPress}
|
||||
accessible={accessible}
|
||||
accessibilityRole="link"
|
||||
accessibilityActions={accessibilityActionsWithActivate}
|
||||
onAccessibilityAction={e => {
|
||||
if (e.nativeEvent.actionName === 'activate') {
|
||||
onPress()
|
||||
} else {
|
||||
onAccessibilityAction?.(e)
|
||||
}
|
||||
}}
|
||||
{...props}
|
||||
android_ripple={{
|
||||
color: t.atoms.bg_contrast_25.backgroundColor,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue