jquery-ui/ui
Michał Gołębiowski-Owczarek 0c5becce0e
Widget: Optimize attachment of the _untrackClassesElement listener
jQuery UI 1.13.0 changed the logic attaching the `_untrackClassesElement`
listener in the `_classes` widget method; one of the side effects was calling
`this._on` for each node that needed the listener. That caused a severe
performance degradation for large comboboxes as each `_on` jQuery UI call
causes a jQuery `add` call that calls Sizzle's `uniqueSort` underneath.

Instead, collect the nodes that need the listener and then, outside of the loop,
create a jQuery object out of them and attach the listener once. That's still
slower than the jQuery 1.12 version but only slightly: 936 ms to 1.03s on a very
large list on a recent MacBook Pro, compared to ~30 seconds before this patch.

Fixes gh-2014
Closes gh-2037
2022-01-15 01:26:23 +01:00
..
effects Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
i18n Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
vendor/jquery-color Build: Update jQuery Simulate, jQuery Migrate & jQuery Color 2020-05-16 08:26:48 +02:00
widgets Autocomplete: Rewrite with a delay instead of appending the live region 2022-01-05 11:35:34 +01:00
.eslintrc.json Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
core.js Docs: Update removal comments to mention 1.14, not 1.13 2021-08-26 13:36:06 +02:00
data.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
disable-selection.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
effect.js Effect: Define the jQuery variable before jQuery Color gets imported 2021-09-03 14:42:30 +02:00
focusable.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
form-reset-mixin.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
form.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
ie.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
jquery-patch.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
jquery-var-for-color.js Effect: Define the jQuery variable before jQuery Color gets imported 2021-09-03 14:42:30 +02:00
keycode.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
labels.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
plugin.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
position.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
safe-active-element.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
safe-blur.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
scroll-parent.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
tabbable.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
unique-id.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
version.js Build: Migrate from JSHint & JSCS to ESLint 2021-06-07 00:58:12 +02:00
widget.js Widget: Optimize attachment of the _untrackClassesElement listener 2022-01-15 01:26:23 +01:00