App: [HOLD for payment 2024-04-05] HIGH: [Mentions] [$500] Pressing`right`arrow key does nothing when mentioning and keeping the cursor after `@` in the compose box
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.4.50-2 Reproducible in staging?: y Reproducible in production?: y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @quinthar Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1710108211692399
Action Performed:
- Open any chat
- in the composer type a message like
Hello @applausetester+mn03@applause.expensifail.com - Then move the cursor to the left end
- Keep pressing “right arrow” key until you reach
@ - After that press “right arrow” again
Expected Result:
Should be able to move to next character
Actual Result:
Pressing “right arrow” does nothing and it stucks there
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android: Native
- Android: mWeb Chrome
- iOS: Native
- iOS: mWeb Safari
- MacOS: Chrome / Safari
- MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
https://github.com/Expensify/App/assets/38435837/f64ed74d-c477-4765-aa45-16802dd200ae
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01e5a6db314206cef2
- Upwork Job ID: 1767261656990289920
- Last Price Increase: 2024-03-11
Issue Owner
Current Issue Owner: @bfitzexpensifyAbout this issue
- Original URL
- State: closed
- Created 4 months ago
- Comments: 38 (24 by maintainers)
Paid out! Ok, we’re all done here, thanks everyone.
Popover menu, emoji picker, attachment picker menu, report context menu, emoji & mention suggestion. Only emoji picker that uses
disableHorizontalKeysI would say we should disable it if
allowHorizontalArrowKeysis false which is what I propose. Currently, every component mentioned above is subscribed to the left and right arrow keys even though they don’t support horizontal navigation. The keyboard shortcut callback already does nothing ifallowHorizontalArrowKeysis false.https://github.com/Expensify/App/blob/92ad1cd2135683b2a0fe4c9b12cb6cd78fbfeaa7/src/hooks/useArrowKeyFocusManager.ts#L171-L174
disableHorizontalKeysis to manually (forcefully) disable the horizontal navigation from outside of the hook, for example in the emoji picker when the emoji text input is focused.I think we can consolidate it by having a single prop called
allowHorizontalArrowKeyswith the default value of false. The horizontal arrow configisActivewill be true ifallowHorizontalArrowKeysis true.Then in the emoji picker, we will set
allowHorizontalArrowKeysto true if the text input is not focused.If other component needs the horizontal navigation, they just need to use
allowHorizontalArrowKeysinstead ofitemsPerRow(edit: we still needitemsPerRow).@tgolen Thanks for sharing your thoughts. Yes, I agree with you that we should not only fix it but also clean up the confusing part.
The root cause of this issue is clear. @Krishna2323 first proposed a quick fix solution, while @GandalfGwaihir was the first to point out the confusing prop
disableHorizontalKeys. Their proposals are close to success, and I believe there’s a lesson to be learned from this experience - Just do a bigger cleanup that is a little larger in scope than the RCA - as suggested by @tgolenI also agree we should go with @bernhardoj 's proposal, along with their follow-up https://github.com/Expensify/App/issues/38076#issuecomment-1994680414, as they provided a consolidated solution to get the code cleaner.
@tgolen All yours.
🎀👀🎀 C+ reviewed
Sorry for the back and forth!
@tgolen, agree with you on making the code better but that could have in handled in the PR phase since I pointed out the correct root cause and a valid solution. We generally do handle these things in the PR.
@tgolen , @bernhardoj pretty much explained all your doubts, i have almost similar explanation, an i was the one to point out the confusing names, so do i need to answer your questions still and where do we proceed from here