Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep highlight in select mode #1420

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Massi-X
Copy link
Contributor

@Massi-X Massi-X commented Nov 30, 2024

Currently when you select a suggestion from the dropdown (with keyboard control), the highlight will return to the top (without scrolling either) and to return to the point you were before you need to scroll endlessly again. This PR fixes the behavior by keeping highlight in the same spot (also, did you notice that the code to highlight the next option never worked? At least in select mode, didn't try anything else).

A real case scenario: A user scroll down with arrows and by mistake selects the wrong value, now he has to scroll down again to were it was, not very user friendly!

And here is the video (the commit there miss the true in highlightOption that I added later to fix highlighting when dropdown is filtered, but is the same for that matter)

1.mov

Massi-X and others added 2 commits November 30, 2024 01:15
Keep highlighted suggestion (dropdown) in the same place after selection with the keyboard
@yairEO
Copy link
Owner

yairEO commented Dec 7, 2024

I don't understand why would a user be endlessly scrolling down instead of start typing the value they aim to seek.

Lets assume the user forgot which value they want, and scrolls in hope of finding it and be reminded.
Then the user sadly selects the wrong value, is annoyed, and wants to select the correct value.

At this point the user should be able to type the value because he/she were just reminded of it by seeing it.

Myself, I do not believe this will happen often, and guessing the user intent is tricky. Keeping the highlight on the selected option first assumes it's visible (because dropdown.includeSelectedTags must be set to true first), and second, assumes the user will benefit from this.

I tend to keep things as they are BUT to add support for Page up Page down home & End keys to quickly navigate the list of suggestions.

Adding support now, will push a new version today

@Massi-X
Copy link
Contributor Author

Massi-X commented Dec 7, 2024

Yes this is a good idea, but to me it seems more user friendly to keep the highlight in the same spot and not jump at the beginning of the list. Maybe you can ask others which way is preferable (or even make an option to enable this behavior?)

@Massi-X
Copy link
Contributor Author

Massi-X commented Dec 8, 2024

Oh and now it comes to my mind this thing! We considered a dropdown in select mode with userInput enabled, but if userInput is disabled? My theory applies and the user has to scroll down again all the way to the value it was searching for!

This is especially true for impaired users

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants