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

Cursor being set on hover causes incorrect selection depending on mouse position #239

Open
justinharrell opened this issue Feb 7, 2021 · 0 comments

Comments

@justinharrell
Copy link

justinharrell commented Feb 7, 2021

Related to #28

Since it was changed that hovering the mouse changes the cursor, if your mouse happens to be over the suggestions when it opens the selection will be based on the mouse position rather than the first one or none depending on the autoSelect option. This would normally happen if say you focus the search input on load and the mouse happens to be in the right place from the previous screen. The larger you're menu the more likely it will occur.

Was there a reason this was changed other than hover styling matching cursor?

The old behavior was actually less confusing, the cursor was based on the keyboard alone, while the mouse could still click a suggestion, the mouse however would not change the cursor. For styling you can style .tt-cursor and .tt-suggestion:hover, you can even style them slightly differently which is what Chrome's omnibox does, the cursor has an extra border highlight to distinguish from mouse "cursor" there are effectively two visible cursors.

I commented the hover code out and it works much better not incorrectly selecting the wrong item if the mouse happens to be over the suggestion area while still allowing the mouse to select a suggestion on click.

IMO this be reverted or at least made an option.

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

No branches or pull requests

1 participant