|
|
@ -1,5 +1,5 @@ |
|
|
|
export function handleGlobalEnterQuickSubmit(target) { |
|
|
|
export function handleGlobalEnterQuickSubmit(target) { |
|
|
|
const form = target.closest('form'); |
|
|
|
let form = target.closest('form'); |
|
|
|
if (form) { |
|
|
|
if (form) { |
|
|
|
if (!form.checkValidity()) { |
|
|
|
if (!form.checkValidity()) { |
|
|
|
form.reportValidity(); |
|
|
|
form.reportValidity(); |
|
|
@ -9,5 +9,10 @@ export function handleGlobalEnterQuickSubmit(target) { |
|
|
|
// here use the event to trigger the submit event (instead of calling `submit()` method directly)
|
|
|
|
// here use the event to trigger the submit event (instead of calling `submit()` method directly)
|
|
|
|
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
|
|
|
|
// otherwise the `areYouSure` handler won't be executed, then there will be an annoying "confirm to leave" dialog
|
|
|
|
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true})); |
|
|
|
form.dispatchEvent(new SubmitEvent('submit', {bubbles: true, cancelable: true})); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
form = target.closest('.ui.form'); |
|
|
|
|
|
|
|
if (form) { |
|
|
|
|
|
|
|
form.querySelector('.ui.primary.button')?.click(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|