-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bug: Option gets selected by mouse cursor position, not current item #48
Comments
i'm not sure i get the issue, this is what i have, it's selecting properly the highlighted option if i press enter Tab-1719087826188.mp4 |
Yeah, this works as expected, but when you move the cursor (could be just accidentally) after having selected an option by keyboard, the selection gets changed unexpectedly... |
mhh yes, but i don't see how it could be otherwise. when you use the keyboard, that's what define the focus. if you move the mouse, it's going to select whatever you are hovering. You need to move it enough that it goes to another option to get the focus, so that's not a "small" move, it's already big enough to select another item. do you know of any other library that does thing differently ? :-) i'm open to suggestions but i'd like to see how that's handled in other projects |
Have a look at this example: https://mdbootstrap.com/docs/standard/forms/autocomplete/ |
soo.... decoupling the focus/selection is not always great for example, i can hover things with the mouse, but then it's not "selected". this means, when using the keyboard, the navigation will start from the top (the first option). This also means that after using the keyboard, if I scroll down, i see the option hovered, but I have no idea anymore what's really selected and pressing enter will lead to the last selected entry... I'm not sure that's great either, and honestly, I don't expect anyone to use the keyboard to select something, THEN move the mouse, AND expecting the input to keep track of whatever was keyboard selected example below Bootstrap-5-autocomplete-demo.mp4unless you have a very good reasoning against this, i'm not going forward with this |
@lekoala Well ok, lets leave this behavior as is for now. But another problem I have is that when my cursor is positioned under the input field and I enter some text and want to submit the entered text by pressing the enter key, the option under the cursor gets selected. This behavior is weird and people expect the entered text to be submitted (compared to autocomplete from search engines etc.). Is there a way to change this? |
that seems reasonable :) can you give it a try? |
@lekoala Thanks, this works fine now... |
and published ;-) |
If you use the arrow keys to select an item from the dropdown and click enter, the option won't get selected. Instead, the option under the mouse cursor position gets selected. This is a weird behavior...
The text was updated successfully, but these errors were encountered: