| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Is it possible to add a test that covers this change? It would probably be similar to the existing DOM integration tests, but for handling multiple changes. |
Sorry, something went wrong.
|
Happy to give it a try, yes. Should I just be testing that selection:update only happens once? Kind of tricky without making the test "wait" for a little bit to check it doesn't get called more than once. |
Sorry, something went wrong.
|
The test I've added fails before my change, but I'm not sure how useful the test case is... Let me know your thoughts |
Sorry, something went wrong.
Because we're still doing best-effort IE8 support for some reason.
* Only trigger 'selection:update' once on DOM change events * Fix linting errors * Add test for adding multiple options to a select * Switch Array.isArray to jQuery.isArray Because we're still doing best-effort IE8 support for some reason. * Fixed formatting in tests Co-authored-by: Kevin Brown <kevin-brown@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
This pull request includes a
The following changes were made
I've had an issue when using select2 with datatables editor. I have a dropdown that has 4000+ elements, loaded via datatables editor and ajax. Everytime I filter/sort/change page on the table a new request fires to get the data the correct page, but also (annoyingly and seemingly unnecessarily) the list of options for the dropdown gets returned again... This then causes the page to become unresponsive as select2 goes through and refreshes the DOM (I think, it's certainly doing something along those lines) 4000+ times for each option being removed, and 4000+ times for each option being added.
This issue didn't exist before 4.0.3, and the below changes fix it. All tests are still passing, but I could very easily have overlooked something important though.