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

Select options(selected class is not removed properly) is not updating properly when choosing options at the bottom of the select #2022

Closed
ghost opened this issue Aug 21, 2018 · 5 comments

Comments

@ghost
Copy link

ghost commented Aug 21, 2018

@krthi commented on Jul 30, 2018, 1:40 PM UTC:

The select options are not refreshed properly when options at the bottom of the select is chosen or when there are many options or when the height of the select box is less. I am using the latest version of the bootstrap select (v1.13.1) and bootstrap version 4. This is not multiselect

Steps to reproduce the bug,

  1. Open the select
  2. Choose the last option in the select box
  3. Open the select and choose second last option, The highlight of the previously chosen option(selected class) is not removed, Open again and choose third last option still highlight is not removed
  4. When there are some events(like scroll) the options refreshed properly
  5. Here is the working fiddle, https://jsfiddle.net/aarthi_101/79rz3j1w/18/

This issue was moved by caseyjhol from snapappointments/bootstrap-select-temp#85.

@ogeieben
Copy link

Hi all,
Any news about this bug? I am using v1.13.8 and the bug still exists. Any workaround?
Thanks in advance!

@caseyjhol caseyjhol self-assigned this Mar 29, 2019
@caseyjhol
Copy link
Member

caseyjhol commented Mar 29, 2019

Looks like this is only happening if the menu is under a certain height: https://jsfiddle.net/caseyjhol/t5zgdhjm/1/.

Edit: It was only using the currently visible elements to update the selected attributes, so elements that were "below the fold" were ignored.

@caseyjhol
Copy link
Member

Released in v1.13.9!

@ogeieben
Copy link

ogeieben commented Apr 1, 2019

Hello Casey, I am posting here because I think it might be related...
I have discovered another bug with long lists of options grouped with < optgroup >.
If you select an element somewhere in the list and you open the selectpicker again, the scroll position is not on the selected element.. It seems to be ok with elements at the beginning and the end of the list. It is also ok without < optgroup > tags. See here: https://jsfiddle.net/dhwrcvuq/

@caseyjhol
Copy link
Member

@ogeieben While a similar issue, this is different enough that I created a separate issue: #2251.

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