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

Change 'click' event into 'mousedown' #1413

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 18, 2024

This prevents the dropdown from closing when the user starts a selection (mousedown) within the input and ends it (mouseup) outside of the input

This prevents the dropdown from closing when the user starts a selection (mousedown) within the input and ends it (mouseup) outside of the input
mouseup event isn't really needed and was causing focus loss when clicking a suggestion
@Massi-X Massi-X changed the title Distinguish between mouseup and mousedown events Change 'click' event into 'mousedown' Nov 18, 2024
@yairEO
Copy link
Owner

yairEO commented Nov 23, 2024

selection of what? what are the steps to reproduce? a video would be nice :)

@Massi-X
Copy link
Contributor Author

Massi-X commented Nov 24, 2024

Hi @yairEO I can't trigger the bug with unpatched 4.32.1 version, so this could be related to some of my commits in #1410. You could wait to review that but in any case I found this fixes another incorrect behavior (at least to me) that is the border focus style being lost when the selection ends outside the input, see video (for clarity I click the mouse inside the input, drag to select and release it outside of the input borders)

1.mov

@yairEO
Copy link
Owner

yairEO commented Nov 25, 2024

Also need to test how this affects mobile users where the click event was translated into a touch event

@Massi-X
Copy link
Contributor Author

Massi-X commented Nov 25, 2024

Yep

PS. It should be fine https://caniuse.com/?search=mousedown

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