This commit is contained in:
Dennis Eichhorn 2023-10-09 22:06:39 +00:00
parent 72f2c2e1d1
commit 9adb343cf5
2 changed files with 7 additions and 3 deletions

View File

@ -729,8 +729,6 @@ export class Form
formActionCancel (self, event, id, elementIndex)
{
jsOMS.preventAll(event);
const ele = document.getElementById(id);
if (ele.getAttribute('data-update-form') === null && ele.tagName.toLowerCase() !== 'form') {
this.formActionCancelInline(self, event, id, elementIndex);
@ -974,6 +972,7 @@ export class Form
} else if ((elementIndex = Array.from(self.forms[id].getSave()).indexOf(event.target)) !== -1) {
this.formActionSave(self, event, id, elementIndex);
} else if ((elementIndex = Array.from(self.forms[id].getCancel()).indexOf(event.target)) !== -1) {
jsOMS.preventAll(event);
// @todo currently only handling update cancel, what about add cancel?
this.formActionCancel(self, event, id, elementIndex);
} else if ((elementIndex = Array.from(self.forms[id].getUpdate()).indexOf(event.target)) !== -1) {

View File

@ -236,11 +236,16 @@ export class FormView
const parent = e === null ? document : e;
return parent.querySelectorAll(
'button[form=' + this.id + '].cancel-form, '
'#' + this.id + ' input[type=reset], '
+ 'button[form=' + this.id + '][type=reset], '
+ 'input[form=' + this.id + '][type=reset], '
+ '#' + this.id + ' button[type=reset], '
+ 'button[form=' + this.id + '].cancel-form, '
+ '.cancel-form[data-form=' + this.id + '], '
+ '#' + this.id + ' .cancel-form, '
+ '[form="' + this.id + '"].cancel-form'
+ (e !== null ? ', .cancel-form' : '')
);
};