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

Multi-Value Select Boxes show selected options #5755

Closed
fafejtao opened this issue Jan 28, 2020 · 1 comment
Closed

Multi-Value Select Boxes show selected options #5755

fafejtao opened this issue Jan 28, 2020 · 1 comment

Comments

@fafejtao
Copy link

fafejtao commented Jan 28, 2020

There are 3 bugs in version 4.0.x when using multi-value select with optgroup.
Version 3.5.3 works correctly.

Here is source code
version 4.0.x: bug
https://codepen.io/fafejtao/pen/mdyYJbP

version 3.5.3 works correctly
https://codepen.io/fafejtao/pen/qBEGdpd

https://github.com/fafejtao/select2_bug

  1. selected options are still visible in autocomplete
    • Steps to reproduce:
    1. type Alaska
    2. press enter to select Alaska
    3. type Alaska again - expected: option is not visible, actual: option is still visible
  2. removing selected option opens autocomplete
    • Steps to reproduce:
    1. type Alaska
    2. press enter to select Alaska
    3. click to 'x' to remove Alaska - expected: option is removed, actual: option is removed and autocomplete is shown
  3. mouse click and keyboard enter behave differently
    • Steps to reproduce:
    1. type Alaska
    2. press enter to select Alaska
    3. type Alaska again (due to bug#1 this option is still available)
    4. press enter (nothing happens)
    5. type Alaska again (due to bug#1 this option is still available)
    6. click mouse to select Alaska - expected: should't be available, actual: removes option from selected options
@kevin-brown
Copy link
Member

It's been almost 5 years since the 4.x line of Select2 was released. A lot has changed during that time.

  1. selected options are still visible in autocomplete

That's an accessibility feature, not a bug. There is no way to remove arbitrary options without a mouse if the options aren't visible in the dropdown.

  1. removing selected option opens autocomplete

That's a feature, not a bug. You can find out how to disable it at #3320 (comment).

3. mouse click and keyboard enter behave differently

This is an accessibility feature, not a bug. CTRL + SPACE handles toggling a selected option (so both select and unselect). ENTER only selects options. Otherwise you could hold down ENTER and unselect all of your options by mistake.

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