-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[BUGFIX] Onboarding - Modal can be dismissed by ESC key #39927
[BUGFIX] Onboarding - Modal can be dismissed by ESC key #39927
Conversation
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.
LGTM, add some video
merge main into onboarding/escape-button-fix
@johnmlee101 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
@@ -36,6 +37,10 @@ function BaseOnboardingPersonalDetails({currentUserPersonalDetails, shouldUseNat | |||
const {isSmallScreenWidth} = useWindowDimensions(); | |||
const {shouldUseNarrowLayout} = useOnboardingLayout(); | |||
|
|||
useEffect(() => { | |||
Modal.setDisableDismissOnEscape(true); | |||
}, []); |
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.
I believe it works but I think it's not really good. We set on/off for this prop disableDismissOnEscape
on 2 components, thus in order to keep it working:
- We need to ensure their order
- And if we replace
OnboardingPurpose
component with another component, we need to remember to copy that setter as well.
So I think they're not independent. What do you think if we set it on
on mount, and off
on unmount for each component? We can wrap it into a custom hook and use it on every modal that needs to disable dismiss on ESC.
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.
I agree with @hoangzinh this is a bit fragile logic
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.
Yeah I understand what you mean, I'll rework it accordingly so it applies more properly here.
@hoangzinh I've remade this functionality into a simple hook and added it to the onboarding pages, you can recheck it. |
Thanks @cdOut I'm going to complete review checklist |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-04-11.at.23.01.51.android.movAndroid: mWeb ChromeScreen.Recording.2024-04-11.at.22.34.37.android.chrome.moviOS: NativeScreen.Recording.2024-04-11.at.23.13.34.moviOS: mWeb SafariScreen.Recording.2024-04-11.at.22.54.31.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-04-11.at.22.29.56.web.movMacOS: DesktopScreen.Recording.2024-04-11.at.22.32.00.desktop.mov |
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.
LGTM
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.
Thank you
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.63-0 🚀
|
This PR is failing because of issue #39834 The issue is reproducible in: Web and Desktop environments 2024-04-19.17-22-54.mp4 |
🚀 Deployed to production by https://github.com/mountiny in version: 1.4.63-21 🚀
|
Details
Fixed Issues
$ #39834
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
ANDROID-NATIVE.mov
Android: mWeb Chrome
ANDROID-CHROME.mov
iOS: Native
IOS-NATIVE.mov
iOS: mWeb Safari
IOS-SAFARI.mov
MacOS: Chrome / Safari
CHROME.mov
MacOS: Desktop
DESKTOP.mov