-
Notifications
You must be signed in to change notification settings - Fork 3.7k
fix: The fields of code are not announced #85504
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
82ea7e3
9b447c3
80d2c74
5cdb105
7bcae39
df79038
f91eed7
020d634
4becb5c
870c0de
61852ed
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,6 +5,7 @@ import {StyleSheet, View} from 'react-native'; | |
| import {Gesture, GestureDetector} from 'react-native-gesture-handler'; | ||
| import Animated, {useAnimatedStyle, useSharedValue, withDelay, withRepeat, withSequence, withTiming} from 'react-native-reanimated'; | ||
| import type {ValueOf} from 'type-fest'; | ||
| import useAccessibilityAnnouncement from '@hooks/useAccessibilityAnnouncement'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import useNetwork from '@hooks/useNetwork'; | ||
| import useStyleUtils from '@hooks/useStyleUtils'; | ||
|
|
@@ -213,6 +214,9 @@ function MagicCodeInput({ | |
| editIndex.current = index; | ||
| }; | ||
|
|
||
| const announcement = focusedIndex !== undefined ? translate('common.enterDigitLabel', {digitIndex: focusedIndex + 1, totalDigits: maxLength}) : undefined; | ||
| useAccessibilityAnnouncement(announcement, !!announcement, {shouldAnnounceOnNative: true, shouldAnnounceOnWeb: true}); | ||
|
|
||
| useImperativeHandle(ref, () => ({ | ||
| focus() { | ||
| focusMagicCodeInput(); | ||
|
|
@@ -467,7 +471,7 @@ function MagicCodeInput({ | |
| <GestureDetector gesture={tapGesture}> | ||
| {/* Android does not handle touch on invisible Views so I created a wrapper around invisible TextInput just to handle taps */} | ||
| <View | ||
| style={[StyleSheet.absoluteFillObject, styles.w100, styles.h100, styles.invisibleOverlay]} | ||
| style={[StyleSheet.absoluteFill, styles.w100, styles.h100, styles.invisibleOverlay]} | ||
| collapsable={false} | ||
| > | ||
| <TextInput | ||
|
|
@@ -512,6 +516,8 @@ function MagicCodeInput({ | |
|
|
||
| return ( | ||
| <View | ||
| accessibilityElementsHidden | ||
| importantForAccessibility="no-hide-descendants" | ||
|
Comment on lines
+519
to
+520
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Hiding every digit cell here removes the only accessible copy of the code. The backing Useful? React with 👍 / 👎.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @MelvinBot Do you have any suggestions on this? Should we update the |
||
| key={index} | ||
| style={maxLength === CONST.MAGIC_CODE_LENGTH ? [styles.w15] : [styles.flex1, index !== 0 && styles.ml3]} | ||
| > | ||
|
|
@@ -533,6 +539,7 @@ function MagicCodeInput({ | |
| accessibilityElementsHidden | ||
| importantForAccessibility="no-hide-descendants" | ||
| accessible={false} | ||
| aria-hidden | ||
| > | ||
| {!!char && <Text style={[styles.magicCodeInput, styles.textAlignCenter, styles.opacity0]}>{char}</Text>} | ||
| <Text style={[styles.magicCodeInput, {width: 1}]}> </Text> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.