selectize.js icon indicating copy to clipboard operation
selectize.js copied to clipboard

"Slight Performance Tweaks" is a severe breakage

Open rotdrop opened this issue 2 months ago • 2 comments

Referring to commit

d2564a0a

This commit damages consistency in the calling code (attached event handlers references to the this.$input element) because it deletes the current $input element and attaches another similar element again. But similar in the context of object references is just not "equal" but "different". This commit is altogether evil.

rotdrop avatar Nov 05 '25 21:11 rotdrop

@risadams Can you please revert this commit? It breaks the consistency with jQuery objects in the calling code as it deletes DOM elements and replaces them by other similar DOM elements.

rotdrop avatar Nov 05 '25 21:11 rotdrop

Talking about these lines of code: https://github.com/selectize/selectize.js/blob/e6ca6d3ba8f902c38da157f2caf7962c38e82095/src/selectize.js#L268-L278

This code replaces the primary DOM-element by an equivalent copy. This is at the very least extremely unexpected.

rotdrop avatar Nov 05 '25 21:11 rotdrop