-
Notifications
You must be signed in to change notification settings - Fork 3k
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 pressing Enter key still triggers the Create Group while Shortcut modal opens. #18273
Conversation
…t by pressing enter
@robertjchen @mollfpr One of you needs to 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] |
@mollfpr Could you please have a look? |
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.
Thanks @azimgd for this PR. Just need some clarity.
Thanks @mollfpr, addressed your comments. |
Thanks @azimgd looks better now! I'll start testing it now. |
Tested
|
@azimgd There's a regression in the group split bill confirmation list; pressing
Screen.Recording.2023-05-03.at.15.38.14.mov |
Another issue we already address is the issue about the arrow key in the options list. When the Screen.Recording.2023-05-03.at.15.41.41.mov |
Thank you for your detailed review @mollfpr, fixed both issues. |
Reviewer Checklist
Screenshots/VideosWeb18273.Web.movMobile Web - Chrome18273.mWeb.Chrome.movMobile Web - Safari18273.mWeb.Safari.mp4Desktop18273.Desktop.moviOS18273.iOS.mp4Android18273.Android.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.
Thanks @azimgd for the quick update!
Just small detail and we will good to go.
@@ -40,19 +40,50 @@ class KeyboardShortcutsModal extends React.Component { | |||
KeyboardShortcutsActions.showKeyboardShortcutModal(); | |||
}, openShortcutModalConfig.descriptionKey, openShortcutModalConfig.modifiers, true); | |||
|
|||
const closeShortcutModalConfig = CONST.KEYBOARD_SHORTCUTS.ESCAPE; | |||
this.unsubscribeEscapeModal = KeyboardShortcut.subscribe(closeShortcutModalConfig.shortcutKey, () => { | |||
/** |
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.
Just small detail, I believe this comments block should use //
instead /**
in the block 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.
What's your idea behind using inline vs multiline codeblock?
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.
We mainly use multiline code blocks for the JSDoc and the prop-types comment. I couldn't find documentation, but I recall we've reviewed this before.
@robertjchen Could you help confirm this?
I'm okay if we are not strict about it now, just something came up in my mind.
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.
Got you, thanks. Updated.
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.
Thanks @azimgd! LGTM and tests well 👍
All yours @robertjchen
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!
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/robertjchen in version: 1.3.10-0 🚀
|
🚀 Deployed to production by https://github.com/roryabraham in version: 1.3.12-0 🚀
|
const closeShortcutEnterModalConfig = CONST.KEYBOARD_SHORTCUTS.ENTER; | ||
this.unsubscribeCloseEnterModal = KeyboardShortcut.subscribe(closeShortcutEnterModalConfig.shortcutKey, () => { | ||
ModalActions.close(); | ||
KeyboardShortcutsActions.hideKeyboardShortcutModal(); | ||
}, closeShortcutEnterModalConfig.descriptionKey, closeShortcutEnterModalConfig.modifiers, true, () => !this.props.isShortcutsModalOpen); | ||
|
||
// Intercept arrow up and down keys to prevent scrolling ArrowKeyFocusManager while this modal is open | ||
const arrowUpConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_UP; | ||
this.unsubscribeArrowUpKey = KeyboardShortcut.subscribe(arrowUpConfig.shortcutKey, () => { | ||
}, arrowUpConfig.descriptionKey, arrowUpConfig.modifiers, true, () => !this.props.isShortcutsModalOpen); | ||
|
||
const arrowDownConfig = CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN; | ||
this.unsubscribeArrowDownKey = KeyboardShortcut.subscribe(arrowDownConfig.shortcutKey, () => { | ||
}, arrowDownConfig.descriptionKey, arrowDownConfig.modifiers, true, () => !this.props.isShortcutsModalOpen); |
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.
Following BugZero checklist: This code caused the regression here: #18420
Details
Adds enter shortcut for KeyboardShortcutsModal so that you can close it by pressing enter. Decrease priority for Enter keys on BaseOptionsSelector and MoneyRequestAmountPage modals.
Fixed Issues
$ #17590
PROPOSAL: #17590 (comment)
Tests
Offline tests
Same as Tests.
QA Steps
Same as Tests.
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
Screen.Recording.2023-05-02.at.19.36.55.mov
Mobile Web - Chrome
(not applicable)
Mobile Web - Safari
(not applicable)
Desktop
shortcuts2.mov
iOS
(not applicable)
Android
(not applicable)