diff --git a/web_src/js/modules/fomantic/modal.js b/web_src/js/modules/fomantic/modal.js index 7c9aade79..8b455cf4d 100644 --- a/web_src/js/modules/fomantic/modal.js +++ b/web_src/js/modules/fomantic/modal.js @@ -19,7 +19,9 @@ function ariaModalFn(...args) { // In such case, the "Enter" key will trigger the "cancel" button instead of "ok" button, then the dialog will be closed. // It breaks the user experience - the "Enter" key should confirm the dialog and submit the form. // So, all "cancel" buttons without "[type]" must be marked as "type=button". - $(el).find('form button.cancel:not([type])').attr('type', 'button'); + for (const button of el.querySelectorAll('form button.cancel:not([type])')) { + button.setAttribute('type', 'button'); + } } } return ret;