Conversation
| "expo-av": "~13.10.4", | ||
| "expo-image": "1.11.0", | ||
| "expo-image-manipulator": "11.8.0", | ||
| "focus-trap-react": "^10.2.3", |
There was a problem hiding this comment.
Request was resolved successfully
| @@ -0,0 +1,5 @@ | |||
| import SCREENS from '@src/SCREENS'; | |||
|
|
|||
| const BOTTOM_TAB_SCREENS: string[] = [SCREENS.HOME, SCREENS.SETTINGS.ROOT]; | |||
There was a problem hiding this comment.
Instead of string[], use BottomTabName[]
DetailsFixed Issues$ #36476 Tests
Offline testsN/A QA StepsSame as in Tests
PR Author Checklist
Screenshots/VideosAndroid: NativeN/A Android: mWeb ChromeN/A iOS: NativeN/A iOS: mWeb SafariN/A MacOS: Chrome / Safariweb-rhp.movweb-context-menu.movMacOS: Desktopdesktop-rhp.movdesktop-context-menu.mov |
Skalakid
left a comment
There was a problem hiding this comment.
LGTM, left one small comment 🛸
| import useWindowDimensions from '@hooks/useWindowDimensions'; | ||
| import type FocusTrapProps from './FocusTrapProps'; | ||
|
|
||
| let activeRouteName = ''; |
There was a problem hiding this comment.
Do we need activeRouteName variable outside the component? Can't we just use, for example, useRef?
There was a problem hiding this comment.
This variable is shared between instances of FocusTrap component
|
Just my opinion: Do we need to put additional focustrap in baseModal? |
|
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.83-3 🚀
|
|
Pinged in Slack too, but this might be causing an issue with the debug modal - #43897 . Let me know what you think! |
|
Coming from #43664, there was a regression caused by the focus trap that resulted in the sign in page scrolling to bottom when signing in from a public room. |
| focusTrapOptions={{ | ||
| trapStack: sharedTrapStack, | ||
| allowOutsideClick: true, | ||
| fallbackFocus: document.body, |
There was a problem hiding this comment.
We should disable the initial focus to prevent default selection on popup menus.#43659
|
Hi team. Coming from #43713, there was an issue that the workspace switcher has a blue border after login in mWeb. |
|
This PR caused #43719, a detailed RCA can be found in this proposal: #43719 (comment) |
| /> | ||
| </RootStack.Navigator> | ||
| </View> | ||
| <FocusTrapForScreens> |
There was a problem hiding this comment.
@adamgrzybowski Why do we have FocusTrapForScreens here if each child screen already has a screenwrapper containing it?
There was a problem hiding this comment.
@wildan-m hello, I also worked on this PR so I can answer. The reason is that FullScreenNavigator can display two screens, for example:

In this case we have to disable FocusTrap which is rendered by ScreenWrapper. Otherwise we would have trap active only in red screen or blue screen. FocusTrap over navigator allows us to trap focus in both visible screens.
You can see screens with disabled focus trap in src/components/FocusTrap/WIDE_LAYOUT_INACTIVE_SCREENS.ts file.
There was a problem hiding this comment.
btw are you working on something connected? Maybe we should put the comment in that place
There was a problem hiding this comment.
@jnowakow Thank you for your response. Although I haven't encountered any actual issues yet, I noticed that on smaller screens, when the trap is disabled in the screen wrapper (for some reason), it still traps the focus because the parent container FullScreenNavigator's focus trap exists.
There was a problem hiding this comment.
Okey, so probably it's desired behaviour
Details
This PR adds focus-trap to fix the problem when the user navigates with tab between elements that are not visible.
Fixed Issues
$ #36476
PROPOSAL: #36476 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop