Consistent key press focus logic between composer and emoji picker#31899
Consistent key press focus logic between composer and emoji picker#31899marcaaron merged 9 commits intoExpensify:mainfrom
Conversation
|
@robertKozik 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] |
Reviewer Checklist
Screenshots/VideosAndroid: Nativeandroid.movAndroid: mWeb Chromeandroid.web.moviOS: Nativeios.moviOS: mWeb Safariios.web.movMacOS: Chrome / Safariweb.movMacOS: Desktopdesktop.mov |
|
Could you resolve conficts @dukenv0307 ? |
|
@robertKozik I updated. |
|
Great thanks! I'll proceed with the review then |
|
In the meantime looks like lint is failing on ts |
|
@robertKozik Fixed lint error. |
|
|
||
| focus(); | ||
| replaceSelectionWithText(e.key, false); | ||
| if (e.key.length === 1) { |
There was a problem hiding this comment.
Moving this condition could potencially change the behaviour - regardless of e.key.length value we will focus the input. Before we would return early from the the function without trigerring focus()
There was a problem hiding this comment.
@robertKozik Because now we allow focus for option, cmd, ... which isn't letter key so we should add this condition to prevent replace text when we focus on text input with this key.
There was a problem hiding this comment.
Wasn't the main part of the issue to not focus on modifier keys? Copying from the expected behaviour: The Emoji search field is not focused when clicking on Modifier keys
So we would need this condition to be shared between composer and emoji picker as well
There was a problem hiding this comment.
@robertKozik You're right. Updated with the correct expected.
There was a problem hiding this comment.
D we still need this condition @dukenv0307 ? Beforehand in shouldAutoFocusOnKeyPress we are checking whether e.key.length >1
There was a problem hiding this comment.
Yes we don't need this any more.
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
| if (keyBoardEvent.key === 'Tab' || keyBoardEvent.key === 'Enter' || (keyBoardEvent.key === 'Shift' && searchInputRef.current && !searchInputRef.current.isFocused())) { | ||
| if (!ReportUtils.shouldAutoFocusOnKeyPress(keyBoardEvent)) { |
There was a problem hiding this comment.
This change caused a regression in EmojiPickerMenu. When filtering the emoji list, it's focusing the emoji each time backspace is hit
Screen.Recording.2023-12-06.at.09.58.13.mov
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.4.9-0 🚀
|
1 similar comment
|
🚀 Deployed to staging by https://github.com/marcaaron in version: 1.4.9-0 🚀
|
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 1.4.9-5 🚀
|
Details
Consistent key press focus logic between composer and emoji picker
Fixed Issues
$ #30867
PROPOSAL: #30867 (comment)
Tests
Cmd,Control,Option, ...Offline tests
Same as above
QA Steps
Cmd,Control,Option, ...PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.- [x] I linked the correct issue in the### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)myBool && <MyComponent />.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)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2023-11-27.at.15.18.06.mov
Android: mWeb Chrome
Screen.Recording.2023-11-27.at.15.09.05.mov
iOS: Native
Screen.Recording.2023-11-27.at.15.22.34.mov
iOS: mWeb Safari
Screen.Recording.2023-11-27.at.15.05.22.mov
MacOS: Chrome / Safari
Screen.Recording.2023-11-27.at.14.59.21.mov
MacOS: Desktop
Screen.Recording.2023-11-27.at.15.24.55.mov