[HOLD for payment 2021-12-15] Search - Arrow navigation on search stops working
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
- Press ctrl +k
- Enter something search
- Press the down arrow several times
Expected Result:
User should be able to navigate the search list with the arrow keys.
Actual Result:
Arrow keys stop working after some presses.
Workaround:
User needs to use cursor to select the desired user.
Platform:
Where is this issue occurring?
- Web
- Desktop App
Version Number: 1.1.10-0
Reproducible in staging?: Yes Reproducible in production?: Yes
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
https://user-images.githubusercontent.com/44479856/139509654-36406161-92e2-4e63-8798-ab40e724d50c.mp4
Expensify/Expensify Issue URL:
Issue reported by: @iwiznia Slack conversation: https://expensify.slack.com/archives/C01GTK53T8Q/p1635526745251400
Triggered auto assignment to @sketchydroide (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Hey, I found the root cause and here are some approaches to fix this issue!
Proposal
Root cause
We are dismissing the keyboard on scroll, and this has a side effect of unfocusing the TextInput (source here) which means our key presses for arrow keys cannot be handled by text input in OptionsSelector component.
https://github.com/Expensify/App/blob/973dcf4d6ef737630eeac61b57dbd95b183a092b/src/components/OptionsList.js#L243
Fix method 1
We can simply create index.native.js and index.js files for the OptionsList component.
The index.js file won't dismiss the keyboard on scroll, while the index.native.js would.
i.e. Remove these props for index.js
https://github.com/Expensify/App/blob/973dcf4d6ef737630eeac61b57dbd95b183a092b/src/components/OptionsList.js#L242-L243 This is a straightforward solution and the one which I'm leaning towards.
Fix method 2
Instead of using Keyboard.dismiss(), create and use a new react native method Keyboard.hide() which hides the keyboard without losing focus onTextInput.
But I highly doubt this would be merged into react native because on mobile, there is little utility in dismissing the keyboard and keeping text input focused.
So I just confirmed this is happening on Desktop, and I think this is a bug and that it can be external.
Triggered auto assignment to @arielgreen (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
as a bug this should not be affected by our hold @arielgreen
@sketchydroide, @arielgreen Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
Triggered auto assignment to @Julesssss (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Posted job to Upwork - https://www.upwork.com/jobs/~01efbeab7e7a77a547
@Julesssss can you please also review @rushatgabhane's proposal above?
Hi @rushatgabhane. I also think proposal 2 would be useful, but as it will be difficult to get merged let's go with 1. I think it's still a good solution.
@arielgreen please hire @rushatgabhane
Pending hold lift.
I am reviewing the PR, I have found one issue and I will let you know @Julesssss when this is ready for final review and possibly for merge. See More [extended for C+]
Triggered auto assignment to @mallenexpensify (External), see https://stackoverflow.com/c/expensify/questions/8582 for more details.
@mallenexpensify reassigning, I'm off for mat leave!
Merged, awaiting payment
Whoops, the 7 day countdown doesn't start until deployment.
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.1.18-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/6272
- https://github.com/Expensify/App/pull/6272
If no regressions arise, payment will be issued on 2021-12-15. :confetti_ball:
Paid @rushatgabhane , inc. $250 for Company Offsite Hold bonus.