-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Make CMD+Enter work for single-selection pages #9672
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
Conversation
|
|
| this.props.onConfirmSelection(focusedOption); | ||
| if (!focusedOption) { | ||
| return; | ||
| } |
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.
Should this be above the first check since the code inside that block is also using the focusedOption?
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.
Moving this up as you've suggested breaks things, because it prevents CMD+Enter from creating a group chat if there are participants selected and the search bar is highlighted. But as it turns out, onConfirmSelection doesn't really need the focusedOption and that's not really it's intended use. I did an audit of all of it's usages:
- here it's only ever triggered for group chats, and
createGrouptakes no arguments. So I clarified that and replaced the 1:1createChatmethod with a noop. - here invite user takes no arguments
- here
finalizeParticipantstakes no arguments. - here
confirmtake an argument that's only used by thesendMoneyflow. And in thesendMoneyflowonConfirmSelectionis never called. I looked into splittingconfirmintoconfirmSendandconfirmRequest, but it feels out-of-scope and everything seems to be working as expected.
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.
Good eye though!
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.
Ok cool.
|
@marcaaron looks like this was merged without passing tests. Please add a note explaining why this was done and remove the |
Make CMD+Enter work for single-selection pages (cherry picked from commit 7c2c5db)
…9672 🍒 Cherry pick PR #9672 to staging 🍒
|
🚀 Deployed to production by @roryabraham in version: 1.1.79-17 🚀
|

Details
This makes
CMD+Enterwork just likeEnteronOptionsSelectorcomponents that support only a single selection instead of multiple selections.Fixed Issues
$ #9594
Tests / QA Steps
Repeat the QA steps for #7702. On any pages where only a single selection is possible, replace
EnterwithCMD+Enterand everything should work as expected.PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*filesSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)PR Reviewer Checklist
### Fixed Issuessection aboveTestssectionQA stepssectiontoggleReportand notonIconClick).src/languages/*filesSTYLE.md) were followed/** comment above it */displayNamepropertythisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor)thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)Avataris modified, I verified thatAvataris working as expected in all cases)