-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Allow keyboard shortcuts to work on native devices #14168
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
|
@techievivek 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] |
|
We'll need to change this PR to imported the scoped |
|
waiting for the package to be published. |
|
I am on flaky internet till 15 JAN so my reviews can be delayed. I see we are waiting on the final package also. let's get everything ready on this PR.
|
|
Sorry, I didn't get to this one today. I'll get back to it tomorrow! |
|
@luacmartins wrapping up my PR and will un-publish the package tomorrow. |
|
Ok, let me know when it's done and I'll work on publishing it from our end. Thanks! |
|
I am up with the speed now and I will test it once you are done with package changes. |
|
@azimgd did you get a chance to unpublish the package? |
|
yes. 👍 |
|
Ok, I tried publishing but it seems like there's a 24h wait period. I'll try again tomorrow!
|
|
Package published! |
|
@azimgd what's the latest update on this one? |
|
Android commands: |
|
Let's start with the code review when you get a chance. I would like to know if you have any comments on the approach. Overall just couple of things are missing there:
Tested on:
|
|
@azimgd Let's merge main in this first. |
|
@parasharrajat merged |
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.
BUG: The web shortcut CTRL+ I does not work on firefox and chrome. It is working on staging.
- Pressing
CTRL+ Iopens page info dialog on this branch.
Same for CTRL + K & CTRL + SHIFT + K.
|
Mac ? |
|
It does not matter if the platform is Mac or not. It is the web so it should work everywhere. I will test on Mac as well. Give me 10 mins. |
|
I'm well aware of the fact that it should work on any platform. I asked you which platform are you testing on. |
|
Ok, Mac works. |
|
updated. |
|
@parasharrajat any more feedback? |
|
Testing it again in a few minutes. |
|
Have you had a chance to test ? |
|
|
||
| keyboardShortcutModalContainer: { | ||
| maxHeight: '100%', | ||
| flex: '0 0 auto', |
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 revert this change which is unnecessary to this PR.
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.
RN doesn't support '0 0 auto'.
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.
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.
fixed by removing flexGrow on CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE.
That is being used at:
- KeyboardShortcutsModal
- AttachmentModal
Tested against production, results look coorect.
parasharrajat
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.
What are the future plans for this PR? I see that priority is not yet implemented. Why is this still in draft mode?
Can you please add details of the logical changes in the PR description?
| KEYCOMMAND_LIBRARY_SPECIFIC_KEYS: [ | ||
| [['CTRL'], { | ||
| DEFAULT: KeyCommand.constants.keyModifierControl, | ||
| [PLATFORM_OS_MACOS]: KeyCommand.constants.keyModifierCommand, | ||
| }], | ||
| [['CTRL', 'SHIFT'], { | ||
| DEFAULT: KeyCommand.constants.keyModifierControlShift, | ||
| [PLATFORM_OS_MACOS]: KeyCommand.constants.keyModifierShiftCommand, | ||
| }], | ||
| ], |
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.
@luacmartins Do you think it's readable? Do you have any suggestions for this?
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.
Can we try to keep it more in line with what we have here?
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.
May be use CONST to map the platform keys and then map the correct combinations to the keyCommand consts in the function itself.
| } | ||
|
|
||
| return () => unsubscribe(displayName, callbackID); | ||
| 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.
How are we controlling the unsubscribing now?
|
Closing this in favor of #14767 |

Details
Fixed Issues
$ 6883
PROPOSAL: 6883
Tests
Offline tests
QA Steps
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)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)/** comment above it */thisproperly 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)ScrollViewcomponent to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
Android