You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2023-04-07] Selecting an emoji using the tab focus and arrow keys shows a console error. #16348
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.InternalRequires API changes or must be handled by Expensify staffWeeklyKSv2
Press tab to focus and use arrow keys to select an emoji.
Press enter.
Expected Result:
It shouldn't show any console errors.
Actual Result:
It shows a console error.
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Safari
MacOS / Desktop
Version Number: 1.2.88-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 Notes/Photos/Videos:
Please re-state the problem that we are trying to solve in this issue.
When selecting a emoji from the emoji menu using arrow keys after pressing the tab key, it throws a console error.
What is the root cause of that problem?
The error happens because the scrollToHeader function is being called after the modal is closed (after the user selects the emoji with Enter). This function uses the emoji list reference, which is undefined since the emoji menu was closed.
But why is this function being called when we press Enter on an emoji?
When pressing the tab event before pressing enter on the highlighted emoji, the current keyDownHandler focuses on the search input and after pressing an arrow key, it focuses on the CategoryShortcutBar. When pressing enter, the currently focused one it the shortcut bar item, which will trigger the scrollToHeader function, but the dropdown has already closed.
The default tab cycling logic is not being correctly supported, the only supported way is through arrow keys.
What changes do you think we should make in order to solve the problem?
The better solution would be to improve the Tab logic and remove the error. I propose the following:
Allow the EmojiPickerMenuItem to focus when it's being highlighted
pass a isFocused prop to EmojiPickerMenuItem, similar to the isHighlighted but only if keyboardMovement is available
Update the highlight when it's being focused
pass a onFocus prop to EmojiPickerMenuItem that will update the highlightedIndex when it's focused
Allow the default Tab behaviour to cycle through the items in menu
Add a check for keyBoardEvent.key === 'Tab' && keyBoardEvent.key === 'Shift' in keyDownHandler that just returns, allowing the default tab logic to execute
Allow the categories to also be focused by tab default behaviour
necessary to make the tooltip non focusable (or else it will cycle two times inside each button)
if key Enter is pressed outside the emoji list, it should use default behaviour
What alternative solutions did you explore? (Optional)
If we only want to remove the error and not improve the Tab logic, the quick solution would be returning early in scrollToHeader if this.emojiList is not defined, like:
We missed handling tab navigation, so we kind of improvised it here. So this issue is not a regression we can skip the regression checklist.
About the other issue #17194
We know our first PR caused it. We partially added Tab & Tab + Shift navigation but we didn't fully test this one as we kind of planned to leave it for the later broader accessibility project, we kind of rushed into this made missed catching the Regression
Looks like something related to react-navigation may have been mentioned in this issue discussion.
As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our DeprecatedCustomActions.js files should not be accepted.
changed the title [-][HOLD for payment 2023-04-28] [HOLD for payment 2023-04-07] Selecting an emoji using the tab focus and arrow keys shows a console error.[/-][+][HOLD for payment 2023-04-07] Selecting an emoji using the tab focus and arrow keys shows a console error.[/+]on May 8, 2023
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.InternalRequires API changes or must be handled by Expensify staffWeeklyKSv2
Activity
MelvinBot commentedon Mar 21, 2023
Triggered auto assignment to @mateocole (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.MelvinBot commentedon Mar 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)BeeMargarida commentedon Mar 21, 2023
Hi, Ana from Callstack, I can pick this up
MelvinBot commentedon Mar 21, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0143b6a68604602584
MelvinBot commentedon Mar 21, 2023
Triggered auto assignment to Contributor Plus for review of internal employee PR - @Santhosh-Sellavel (
Internal)BeeMargarida commentedon Mar 22, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
When selecting a emoji from the emoji menu using arrow keys after pressing the tab key, it throws a console error.
What is the root cause of that problem?
The error happens because the
scrollToHeaderfunction is being called after the modal is closed (after the user selects the emoji withEnter). This function uses the emoji list reference, which is undefined since the emoji menu was closed.But why is this function being called when we press
Enteron an emoji?When pressing the tab event before pressing enter on the highlighted emoji, the current
keyDownHandlerfocuses on the search input and after pressing an arrow key, it focuses on theCategoryShortcutBar. When pressing enter, the currently focused one it the shortcut bar item, which will trigger thescrollToHeaderfunction, but the dropdown has already closed.The default tab cycling logic is not being correctly supported, the only supported way is through arrow keys.
What changes do you think we should make in order to solve the problem?
The better solution would be to improve the Tab logic and remove the error. I propose the following:
EmojiPickerMenuItemto focus when it's being highlightedisFocusedprop toEmojiPickerMenuItem, similar to theisHighlightedbut only ifkeyboardMovementis availableonFocusprop toEmojiPickerMenuItemthat will update thehighlightedIndexwhen it's focusedkeyBoardEvent.key === 'Tab' && keyBoardEvent.key === 'Shift'inkeyDownHandlerthat just returns, allowing the default tab logic to executeEnteris pressed outside the emoji list, it should use default behaviourWhat alternative solutions did you explore? (Optional)
If we only want to remove the error and not improve the Tab logic, the quick solution would be returning early in
scrollToHeaderifthis.emojiListis not defined, like:47 remaining items
Santhosh-Sellavel commentedon May 1, 2023
@mountiny
We missed handling tab navigation, so we kind of improvised it here. So this issue is not a regression we can skip the regression checklist.
About the other issue #17194
We know our first PR caused it. We partially added Tab & Tab + Shift navigation but we didn't fully test this one as we kind of planned to leave it for the later broader accessibility project, we kind of rushed into this made missed catching the Regression
MelvinBot commentedon May 1, 2023
Looks like something related to
react-navigationmay have been mentioned in this issue discussion.As a reminder, please make sure that all proposals are not workarounds and that any and all attempt to fix the issue holistically have been made before proceeding with a solution. Proposals to change our
DeprecatedCustomActions.jsfiles should not be accepted.Feel free to drop a note in #expensify-open-source with any questions.
mountiny commentedon May 2, 2023
I think this is all ready to be paid @dylanexpensify
In this case we only have a reporting bonus to @Tushu17 and then C+ payment to @Santhosh-Sellavel
dylanexpensify commentedon May 4, 2023
Getting a post up now!
dylanexpensify commentedon May 4, 2023
@Santhosh-Sellavel @Tushu17 please apply here! 🙇
Tushu17 commentedon May 5, 2023
@dylanexpensify Okay applied, Thank you.
Santhosh-Sellavel commentedon May 7, 2023
Applied @dylanexpensify thanks!
dylanexpensify commentedon May 8, 2023
@Santhosh-Sellavel payment sent!
RT here
dylanexpensify commentedon May 8, 2023
@Tushu17 please accept offer so I can send you 💸 😄
Tushu17 commentedon May 8, 2023
@dylanexpensify Offer accepted. Thank you.
[-][HOLD for payment 2023-04-28] [HOLD for payment 2023-04-07] Selecting an emoji using the tab focus and arrow keys shows a console error.[/-][+][HOLD for payment 2023-04-07] Selecting an emoji using the tab focus and arrow keys shows a console error.[/+]dylanexpensify commentedon May 15, 2023
All done!