-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
Description
The entwine onmatch event fires when an element with the relevant selector appears in the DOM. This can be a new element, but it can also be an element being updated.
For example, with the below code, whenever a new element with the changed css class is created or an existing element gets the changed css class added to it, "match" will be printed to the console.
jQuery.entwine('ss', ($) => {
$('.changed').entwine({
onmatch() {
console.log('match');
this._super();
},
onremove() {
console.log('unmatch');
this._super();
},
});
});If the element is removed from the DOM "unmatch" will be printed to the console.
However, if the changed css class is removed from the element, "unmatch" will not be printed, but it should be. This in in contrast to onremove which should only trigger when the element is explicitly removed from the DOM.
Notes
- in NEW Create UnsavedChangesIndicator #2058 a workaround was added because of this bug. After fixing the bug, remove the workaround. See NEW Create UnsavedChangesIndicator #2058 (comment) - Note ensure that a kitchen sink CI run is performed as part of this as the unsaved changes indicator is used throught the CMS