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

Clicking an option after scrolling down the dropdown ends up picking a different option. #1939

Closed
5 tasks done
YoYuUm opened this issue Dec 19, 2022 · 1 comment
Closed
5 tasks done

Comments

@YoYuUm
Copy link

YoYuUm commented Dec 19, 2022

I did:

  • Search for if my issue has already been submitted
  • Make sure I'm reporting something precise that needs to be fixed
  • Give my issue a descriptive and concise title
  • Create a minimal working example on JsFiddle or Codepen
    (or gave a link to a demo on the Selectize docs)
  • Indicate precise steps to reproduce in numbers and the result,
    like below

The proposed fix #1937 has introduced a different bug:

Screen.Recording.2022-12-19.at.14.25.31.mov

Steps to reproduce:

(you need to use last dist in repo in order to reproduce this bug)

  1. Open a select with many options so it is scrollable.
  2. Scroll down the select options and pick one option.
  3. A different option (or no option) gets picked.

Expected result:

Should pick the correct option

Actual result:

Picks a wrong option.

This is most likely happening because in #1937 fix I proposed to focus again the input after it was blurred and the blurred event was ignored. That was helping fixing up another issue described as second example in #1926 . The problem with that fix is that the onBlur call happens on mousedown event, that triggers self.focus() which makes the options dropdown to scroll to the top, so when mouseup event happens, the selected option now is different to the "clicked" option.

I'm not so sure of what the next steps could be, but maybe it would be good to revert #1937 and find a better fix for #1926.

risadams added a commit that referenced this issue Dec 20, 2022
Clicking an option after scrolling down the dropdown ends up picking a different option
@risadams
Copy link
Contributor

Reverted. I will reopen #1926. Thanks

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

2 participants