Description
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.38-0
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: Applause internal team
Slack conversation:
Action Performed:
- Open the emoji picker
- Enter characters in the search field
- Use the back and forward keys
Expected Result:
The back and forward keys should navigate characters entered in the emoji picker's search field
Actual Result:
The back and forward keys are not working properly for navigating back to a character while in use
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
Bug6370743_1707330233368.2024-02-07_22-24-58.mp4
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01a4bbd031958bf120
- Upwork Job ID: 1755301304657534976
- Last Price Increase: 2024-02-07
- Automatic offers:
- jjcoffee | Reviewer | 0
- Krishna2323 | Contributor | 0
Activity
[-]The back and forward keys are not working properly for navigating back to a characters[/-][+][$500] The back and forward keys are not working properly for navigating back to a characters[/+]melvin-bot commentedon Feb 7, 2024
Job added to Upwork: https://www.upwork.com/jobs/~01a4bbd031958bf120
melvin-bot commentedon Feb 7, 2024
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (
External)melvin-bot commentedon Feb 7, 2024
Triggered auto assignment to @miljakljajic (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.ZhenjaHorbach commentedon Feb 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The back and forward keys are not working properly for navigating back to a characters
What is the root cause of that problem?
The main problem with issue is that on EmojiPickerMenu screen we are using useArrowKeyFocusManager which is disabled using arrow keys when index of element is -1
And when input is active,useArrowKeyFocusManager does not allow us to interact with the input
What changes do you think we should make in order to solve the problem?
To fix this issue we can update useArrowKeyFocusManager and add new param
enabledKeyboardsand pass isActive paramAnd when we have focused input we will have only enabled the up and down button in ArrowKeyFocusManager because
enabledKeyboards: [CONST.KEYBOARD_SHORTCUTS.ARROW_UP, CONST.KEYBOARD_SHORTCUTS.ARROW_DOWN]From the other side left and right will be disabled for the emoji list
As a result, events will work as intended
App/src/components/EmojiPicker/EmojiPickerMenu/index.js
Lines 103 to 111 in 82fa188
And then we need update
useArrowKeyFocusManagerAdd
enabledKeyboards = CONST.EMPTY_ARRAYin paramsUpdate arrowConfig
App/src/hooks/useArrowKeyFocusManager.ts
Lines 47 to 53 in 61287bc
And update all
useKeyboardShortcutFor example
CONST.KEYBOARD_SHORTCUTS.ARROW_UPWhat alternative solutions did you explore? (Optional)
NA
Krishna2323 commentedon Feb 7, 2024
Proposal
Please re-state the problem that we are trying to solve in this issue.
The back and forward keys are not working properly for navigating back to a characters
What is the root cause of that problem?
Inside
EmojiPickerMenuWithRefwe useuseArrowKeyFocusManagerwhich catches the arrow key presses and focuses on the emojis instead of changing the input selection.What changes do you think we should make in order to solve the problem?
We need to disable the horizontal key presses when input is focused and we have some text in input. This way we can still use left/right arrow keys if the input is empty.
Steps to solve the bug:
useArrowKeyFocusManagercalledshouldDisableHorizontalKeysand set initial value tofalse.arrowConfigHorizontalKeys.arrowConfigHorizontalKeysforARROW_LEFT&ARROW_RIGHT.EmojiPickerMenupassdisableHorizontalKeys: isFocused && inputText.lengthtouseArrowKeyFocusManager.Result
arrow_keys.mp4
jjcoffee commentedon Feb 8, 2024
Reviewing tomorrow!
jjcoffee commentedon Feb 9, 2024
While both proposals are similar, I prefer @Krishna2323's proposal as it offers a much clearer solution.
One thing though, I think we're not so bothered about the right arrow key navigating from the text input to the first emoji, so we may be able to just leave out the
useStateparts of the proposal that enable that when the text input is empty. Apart from reducing reliance on state, this also ensures consistent behaviour since otherwise you'd be able to navigate to the emojis using the right arrow only when the input is empty, which could be a little confusing.🎀👀🎀 C+ reviewed
11 remaining items
jjcoffee commentedon Feb 21, 2024
Regression Test Proposal
Do we agree 👍 or 👎
[-][$500] The back and forward keys are not working properly for navigating back to a characters[/-][+][HOLD for payment 2024-02-22][$500] The back and forward keys are not working properly for navigating back to a characters[/+]melvin-bot commentedon Feb 26, 2024
@amyevans, @jjcoffee, @miljakljajic, @Krishna2323 Eep! 4 days overdue now. Issues have feelings too...
Krishna2323 commentedon Feb 26, 2024
@miljakljajic can you pls start the payment process?
jjcoffee commentedon Feb 29, 2024
@miljakljajic Friendly bump for payment 🙇
miljakljajic commentedon Feb 29, 2024
Paid - so sorry for the hold up