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

Bug: Event duplication on refresh #2275

Closed
ArneKlein opened this issue May 13, 2019 · 4 comments
Closed

Bug: Event duplication on refresh #2275

ArneKlein opened this issue May 13, 2019 · 4 comments

Comments

@ArneKlein
Copy link

ArneKlein commented May 13, 2019

When using selectpicker('refresh') the click events on the $button are always added, if the html of the select tag has been changed. This leads to a performance degradation, especially for large dropdowns.

A workaround for this bug is to destroy the selectpicker before refreshing it.

As shown in Firefox before refresh:
image

Refresh with the following code:
var dropdown = $('#dropdown'); dropdown.html(''); dropdown.selectpicker('refresh');

image

@caseyjhol
Copy link
Member

Bug reports must include a live demo of the problem. Per our contributing guidelines, please create a reduced test case (you can use our preconfigured Plunker), and report back with:

  • your link
  • Bootstrap version
  • bootstrap-select version
  • specific browser and OS details.

@ArneKlein
Copy link
Author

https://next.plnkr.co/edit/YTeEz4zQAKLyZC2Q

  • Bootstrap 4.1.0
  • Bootstrap-Select 1.13.11
  • All browsers in all operating systems

@caseyjhol
Copy link
Member

Looks like the click listener in the checkDisabled function is the source.

caseyjhol added a commit that referenced this issue Sep 30, 2019
…g if the select is disabled. Bootstrap dropdown already checks for this, and has since v2.0.3. (#2275)
@caseyjhol
Copy link
Member

Released in v1.13.12!

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