-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Add focus trap to the RHP (v3) #32800
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
Add focus trap to the RHP (v3) #32800
Conversation
|
I ran the tests on all platforms but Android, as it crashes on main. Will test it, when it works. Can we do the QA tests after the C+ approves and before merging? |
|
Hey, sorry for the delay. The android was crashing, and then I had a busy week. This is ready for a review. Can we run QA here before merging it into the main? cc @roryabraham |
|
I've resolved conflicts and retested. |
|
I've resolved the conflicts once again. Another bump @fedirjh for review :) |
Reviewer Checklist
Screenshots/VideosAndroid: NativeAndroid: mWeb ChromeCleanShot.2024-01-09.at.22.15.39.mp4iOS: NativeCleanShot.2024-01-09.at.21.07.20.mp4iOS: mWeb SafariCleanShot.2024-01-09.at.21.14.34.mp4MacOS: Chrome / SafariCleanShot.2024-01-09.at.16.24.49.mp4CleanShot.2024-01-09.at.18.02.54.mp4CleanShot.2024-01-09.at.18.05.18.mp4MacOS: DesktopCleanShot.2024-01-09.at.18.21.49.mp4 |
fedirjh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left minor feedback about the code.
|
I've addressed the review and quickly tested it. cc @fedirjh |
fedirjh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and tests well
|
Thanks @fedirjh! Can we please do the QA before merging? Those changes got reverted two times, so it would be safer this way. cc @roryabraham |
|
Kicked off an AdHoc build, requested regression run here |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! 🧪🧪 |
|
I've pulled the main and resolved conflicts. |
Hey @roryabraham, do we have any results of the regression test? |
|
Good question @kosmydel, sorry I didn't follow up. I didn't hear back from Applause after my initial request, so I just pinged them again for confirmation. Will let you know. |
|
Regression is completed. No issues |
Great! Thanks! I'm unsure if I can merge conflicts and test it this week. |
|
I've resolved conflicts again. However, there is an issue (both on main and staging) related to navigation using the tab in the manual request flow. Steps:
Anyway, could you have a final look, as after the regression test I resolved conflicts three times? cc @fedirjh |
@kosmydel Yes I reproduced this issue on staging as well. Edit: This bug is already in production. |
fedirjh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
cc @roryabraham Let's get this merged once @kosmydel resolves the conflicts
roryabraham
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
otherwise LGTM, ready to merge after conflicts are resolved and this one comment is addressed
| focusTrapOptions={{ | ||
| initialFocus: () => (shouldEnableAutoFocus && ref.current) ?? false, | ||
| // eslint-disable-next-line @typescript-eslint/no-non-null-assertion | ||
| fallbackFocus: () => ref.current!, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's avoid disabling this lint rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was discussed here. I'm not sure if we can find a better approach. We need to pass here a function (which can't return null/undefined), but during the initial function call the ref.current is null.
An alternative is, passing an empty string, but not sure if we have any gain from this approach:
fallbackFocus: () => ref.current ?? '',
|
The ideal nav has been merged and it affected the FocusTrap behavior. The reported issue is solved. If we want to change anything in terms of the navigation using the Tab button, please let me know. cc @roryabraham, @fedirjh |
Great, sounds like we can just close this then? |
Details
The third version of the PR as previous versions got reverted (here, and here).
It fixed the following regressions:
#31687
#31725
The issue below was fixed by another PR but was also treated as a regression to this PR.
#31734
Fixed Issues
$ #15631
PROPOSAL: #15631 (comment)
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.src/languages/*files and using the translation methodWaiting for Copylabel for a copy review on the original GH to get the correct copy.STYLE.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 so 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
mweb-android.mov
iOS: Native
ios.mp4
iOS: mWeb Safari
mweb-ios.mp4
MacOS: Chrome / Safari
web.mov
MacOS: Desktop
desktop.mov