Skip to content

Conversation

@bdalsass
Copy link
Contributor

@see https://support.combodo.com/pages/UI.php?operation=details&class=Bug&id=8245

Bug introduced with bug N°8245 since N°7264 Update selectize.js from 0.12.4 to 0.15.2
This version of Selectize library reset the input change listeners on initialization.

Needs a better implementation because the code is quite ugly.

@bdalsass bdalsass added bug Something isn't working internal Work made by Combodo labels Mar 18, 2025
@bdalsass bdalsass requested review from eespie, jf-cbd and rquetiez March 18, 2025 16:54
@bdalsass bdalsass self-assigned this Mar 18, 2025
@steffunky
Copy link
Member

A more elegant way would be to undo your changes and modify how the change listener is added in js/links/links_widget.js.
Line 393 we could remove the listener from the input element itself (that selectize removes on initialization) and put it on the body with a selector that matches our input.

The code would change from this:

$('#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]').off('change').on('change', function () {
    ...
});

to this:

$('body').off('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]')
    .on('change', '#linkedset_'+me.id+' :input[name^="attr_'+me.sAttCode+'["]', function () {
	.....
});

I tested it and it seems to work well

@jf-cbd jf-cbd force-pushed the support/3.2.1 branch 3 times, most recently from e5198dd to b38bf76 Compare March 21, 2025 16:58
@steffunky steffunky merged commit f44468b into support/3.2.1 Mar 24, 2025
@steffunky steffunky deleted the feature/8245-indirect-link-external-key-not-saved branch March 24, 2025 13:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working internal Work made by Combodo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants