Autocomplete preview: handle tab and arrow keys, fix lost focus on iframe load #1886
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I started working on this before #1885 was open but decided to submit it anyway because it has a slightly different approach plus some additional things.
I'm using mostly keyboard to navigate and wanted to get the UX just right 😄
MR addresses the problem with clicking the preview buttons and keeps the focus inside the input all the time. See the video:
preview.mp4
I'm happy to revert/drop changes from my MR as #1885 progresses because this branch has one more thing... The "Close button" and "Open button" didn't match rest of the UI so I've added
eye
andeye-open
to the bundle, and it feels slightly better.One more thing that was missing from me was being able to click "Open" without touching arrow keys, with the icon as button instead of preview I think the icon could be visible all the time. With previous buttons I tried to do that but the UI looked very "busy". What do you think?