- Issue created by @Tuuuukka
- 🇫🇮Finland Tuuuukka
tuuuukka → changed the visibility of the branch more-actions-multiple-click to hidden.
The event listener in https://git.drupalcode.org/project/gin/-/blob/4.0.x/js/more_actions.js?r... might get added multiple times, which is an issue if e.g. a module wants to act on when the form is submitted. And even if the issue is not visible to users, the event should still be added only once per buttonSelector.
Add this to a custom module's JS:
const testSubmit = (form) => {
form.addEventListener('submit', (event) => {
console.log(event);
});
}
Drupal.behaviors.testSubmitEvents = {
attach(context) {
once(
'test-submit-events',
context.getElementsByClassName('node-article-edit-form')
).forEach(testSubmit);
},
};
...and make sure it is loaded.
Use once() to make sure the event handler gets added only once per buttonSelector.
Active
4.0
Code
tuuuukka → changed the visibility of the branch more-actions-multiple-click to hidden.