-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Consistent key press focus logic between composer and emoji picker #31899
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. |
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.
Few questions
src/pages/home/report/ReportActionCompose/ComposerWithSuggestions/ComposerWithSuggestions.js
Show resolved
Hide resolved
@@ -457,7 +446,9 @@ function ComposerWithSuggestions({ | |||
} | |||
|
|||
focus(); | |||
replaceSelectionWithText(e.key, false); | |||
if (e.key.length === 1) { |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robertKozik You're right. Updated with the correct 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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we don't need this any 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.
@robertKozik 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.
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. |
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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)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.- [x] I linked the correct issue in the### 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)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
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