File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -269,8 +269,7 @@ function BaseModal({
269269 ] ,
270270 ) ;
271271
272- const shouldShowBottomDockedDismissButton =
273- isSmallScreenWidth && type === CONST . MODAL . MODAL_TYPE . BOTTOM_DOCKED && ! ! ( onBackdropPress ?? onClose ) && isScreenReaderEnabled ;
272+ const shouldShowBottomDockedDismissButton = isSmallScreenWidth && type === CONST . MODAL . MODAL_TYPE . BOTTOM_DOCKED && ! ! ( onBackdropPress ?? onClose ) && isScreenReaderEnabled ;
274273
275274 const initialFocusTarget = useMemo ( ( ) => {
276275 if ( ! isWeb || ! shouldShowBottomDockedDismissButton ) {
@@ -422,6 +421,7 @@ function BaseModal({
422421 onPress = { handleBackdropPress }
423422 accessibilityRole = { CONST . ROLE . BUTTON }
424423 accessibilityLabel = { translate ( 'modal.dismissDialog' ) }
424+ sentryLabel = "Modal-DismissDialog"
425425 style = { styles . bottomDockedModalDismissButton }
426426 shouldUseAutoHitSlop
427427 >
Original file line number Diff line number Diff line change @@ -9,19 +9,23 @@ const useScreenReaderStatus = (): boolean => {
99 const [ isScreenReaderEnabled , setIsScreenReaderEnabled ] = useState ( false ) ;
1010 useEffect ( ( ) => {
1111 let isMounted = true ;
12- AccessibilityInfo . isScreenReaderEnabled ( )
13- . then ( ( enabled ) => {
14- if ( ! isMounted ) {
15- return ;
16- }
17- setIsScreenReaderEnabled ( enabled ) ;
18- } )
19- . catch ( ( ) => { } ) ;
12+ const isScreenReaderEnabledAsync = AccessibilityInfo . isScreenReaderEnabled ;
13+ if ( isScreenReaderEnabledAsync ) {
14+ isScreenReaderEnabledAsync ( )
15+ . then ( ( enabled ) => {
16+ if ( ! isMounted ) {
17+ return ;
18+ }
2019
20+ setIsScreenReaderEnabled ( enabled ) ;
21+ } )
22+ . catch ( ( ) => { } ) ;
23+ }
2124 const subscription = AccessibilityInfo . addEventListener ( 'screenReaderChanged' , ( enabled ) => {
2225 if ( ! isMounted ) {
2326 return ;
2427 }
28+
2529 setIsScreenReaderEnabled ( enabled ) ;
2630 } ) ;
2731
You can’t perform that action at this time.
0 commit comments