-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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(36381): blur composer on edit menu action #37861
Conversation
Note: During my testing against the latest main, I observed that the Android composer on the web behaves differently from the other mobile experiences. After opening up the menu actions of a row. IOS web, native and android native keeps it focused, android web does not. I confirmed this is unrelated to my changes. My changes are only changing the desktop flows where the mini context button is used. |
@hoangzinh 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] |
/** | ||
* Can be used to control the click event, and for example whether or not to lose focus from the composer when pressing the item | ||
*/ | ||
shouldPreventDefault?: boolean; |
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.
I'm thinking is there any better name for this prop? shouldPreventDefault
is vague to me, we don't know which default would it prevent until we read the description. What do you think?
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.
I do see the point.
Preventdefault is a JavaScript api so when keeping it vague I intended it to just mean call the preventDefault api on all click events that click this action.
But if we want it to indicate the user experience, but would preventDefaultClickEvent be a bit better?
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.
It's better, or we can shouldPreventDefaultFocusOnPress
same as haha
App/src/components/OptionRow.tsx
Line 107 in 9302ade
shouldPreventDefaultFocusOnSelectRow = false, |
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.
Updated!
@jeremy-croff Step 13 looks redundant in "Tests" + Step 3 looks redundant in "QA Tests", doesn't it? |
@jeremy-croff could you help to fix Lint as well? |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-03-11.at.21.40.51.android.movAndroid: mWeb ChromeScreen.Recording.2024-03-11.at.21.43.16.android.chrome.moviOS: NativeScreen.Recording.2024-03-11.at.21.38.08.ios.moviOS: mWeb SafariScreen.Recording.2024-03-11.at.21.47.23.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-03-11.at.21.28.31.web.movMacOS: DesktopScreen.Recording.2024-03-11.at.21.31.59.desktop.mov |
I feel like step 13 is an important new behavior that demonstrates that since the menu items are now focused when you press the 3 dot menu, it also activates the arrow keys of the keyboard, allowing you to switch between them. This previously didn't work. Step 3, as part of QA, is the main flow that's addressed in the ticket; I'm unclear why it's redundant. |
Doesn't it cover in step 5 & 9? Because from step 12, we can test step 13 without tapping on three-dot menu
I mentioned it incorrectly. I mean step 9 |
Yep! When reading it in context you're totally right. 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.
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/bondydaa in version: 1.4.51-0 🚀
|
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.51-3 🚀
|
Details
Fixed Issues
$ #36381
PROPOSAL: #36381 (comment)
Tests
For web and desktop:
Open a report
Focus a composer
Hover a previous message and press the three dot menu
Ensure the composer is unfocused
Check that the keyboard arrows work for the popped out menu from the menu options
From a non focused composer
Hover a previous message and press the three dot menu
Ensure the composer is unfocused
Check that the keyboard arrows work for the popped out menu from the menu options
From a focused composer
Hover a previous message and press the quick reaction emojis
Ensure the composer is stays focused
For mobile:
Offline tests
When offline, perform the same steps to ensure the focus is lost when going to the three dot menu.
QA Steps
Open a report
Focus a composer
Hover a previous message and press the three dot menu
Ensure the composer is unfocused
Check that the keyboard arrows work for the popped out menu from the menu options
From a focused composer
Hover a previous message and press the quick reaction emojis
Ensure the composer is stays focused
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.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
2024-03-06_21-33-23.mp4
Android: mWeb Chrome
2024-03-06_21-18-59.mp4
iOS: Native
2024-03-06_20-34-18.mp4
iOS: mWeb Safari
2024-03-06_20-03-05.mp4
MacOS: Chrome / Safari
2024-03-06_19-31-48.mp4
MacOS: Desktop
2024-03-06_19-37-25.mp4