-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix: prevent callback from being called twice #32
Conversation
Sorry for the delay. I'm in some sort of time, so I'll review this PR in the morning 🙏 |
Bump |
Sorry for the delay. I got sick last week 🙏 It tests well on Web, mWeb, and Desktop. For iOS, I only test it with a macbook on-screen keyboard. For Android, the result is different. Test on the emulator and on-screen keyboard is working well on the CMD+Enter for selecting the currency option. Another test I do is build the app on an Android physical device and connect an external keyboard, but CTRL+Enter results dismiss the page instead of selecting the currency. android.keyboard.mp4 |
No problem! Thanks, let me test. On android perhaps it's caching the package and needs npm run clean before building, but I will dig into it. |
Thanks @samh-nl this might be it. I'll try to clear the catch first. |
@samh-nl I cleared the cache when running the Android build, but the issue still persists on the physical device. |
@samh-nl Any update here? |
I've reproduced it and currently working on it. |
On staging (but also main & prod) I see the following bug with this component: Screen.Recording.2023-08-25.at.17.35.54.mp4It seems specific to when a list item is focused, here done by me pressing tab, and doesn't occur when the focus is on the search input (like in the bug report video of this issue). Note that in the video above I also press just Enter and get the same behavior that the page closes, so there seems to be an issue present unrelated to cmd/modifier flags. Could the problem you've seen be related to this, because there too it only happens when focusing a list item but not when the search input is focused. What do you think? |
I'm not really sure, The issue you mention above seems specific to Safari, but that only dismisses the page on Tab then Enter. Works fine on Tab, then CMD+Enter. My issue here is related to the CTRL+Enter, on the highlighted item. Meanwhile, Safari with Tab doesn't highlight the item, and pressing CMD+Enter doesn't select the focused item (it seems different between focused and highlighted items). I'll do another test in the morning. |
I just did another test on Android with the latest main. I couldn't reproduce the issue here, so I think we are good to go. |
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 👍
cc @johnmlee101
Hey @mollfpr would you mind doing a quick faux-checklist? I know its not required in these repos but it would be nice to capture your testing there |
@samh-nl I tested again on Android with the latest
|
@mollfpr I will check this tomorrow. |
Update - I have an understanding of the problem, on Android we override the modifier flags for arrows. |
@mollfpr I have pushed a commit to solve. For keys that have no display label (which we use for value of However, we only listen for a matching On main (Android) I noticed that pressing Enter opens a report. Possibly a problem with focus being kept, worth keeping in mind since it also happens there (and would therefore be unrelated to this PR). |
Thanks @samh-nl for the update, and the investigation. I'll retest the PR soon. |
Android tested on Samsung device. Reviewer Checklist
Screenshots/VideosWeb23395.Web.mp4Mobile Web - Chrome23395.mWeb.Chrome.mp4Mobile Web - Safari23395.mWeb-Safari.mp4Desktop23395.Desktop.mp4iOS23395.iOS.mp4Android23395.Android.mp4 |
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 and tests well 👍
Friendly bump @johnmlee101 for final review. |
Details
Previously, pressing CMD+Enter (or a different key and a modifier) would trigger a listener twice due to a missing check for the correct modifier flags.
Fixed Issues
$ Expensify/App#23395
PROPOSAL: Expensify/App#23395 (comment)
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 methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)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
Web
Web.Screen.Recording.2023-08-14.at.10.14.26.mp4
Mobile Web - Chrome
mWeb.Chrome.Screen.Recording.2023-08-14.at.13.06.17.mp4
Mobile Web - Safari
mWeb.Safari.Screen.Recording.2023-08-14.at.10.27.41.mp4
Desktop
Desktop.Screen.Recording.2023-08-14.at.10.20.49.mp4
iOS
Native.iOS.Screen.Recording.2023-08-14.at.10.23.51.mp4
Android
Native.Android.Screen.Recording.2023-08-14.at.12.58.55.mp4