From a364060fc889f562f6a0bb14095bc41312862900 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 12 May 2023 10:06:55 -0600 Subject: [PATCH] Fix confirm dialog sometimes mis-placed initiating button in value --- api/js/etemplate/Et2Dialog/Et2Dialog.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/api/js/etemplate/Et2Dialog/Et2Dialog.ts b/api/js/etemplate/Et2Dialog/Et2Dialog.ts index b261756f71..006a718323 100644 --- a/api/js/etemplate/Et2Dialog/Et2Dialog.ts +++ b/api/js/etemplate/Et2Dialog/Et2Dialog.ts @@ -1205,7 +1205,7 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) static confirm(_senders, _dialogMsg, _titleMsg, _postSubmit?) { let senders = _senders; - let buttonId = _senders.id; + let button = _senders; let dialogMsg = (typeof _dialogMsg != "undefined") ? _dialogMsg : ''; let titleMsg = (typeof _titleMsg != "undefined") ? _titleMsg : ''; let egw = _senders instanceof et2_widget ? _senders.egw() : undefined; @@ -1215,7 +1215,7 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) { if(_postSubmit) { - senders.getRoot().getInstanceManager().postSubmit(buttonId); + senders.getRoot().getInstanceManager().postSubmit(button); } else if(senders.instanceOf(et2_button) && senders.getType() !== "buttononly") { @@ -1225,7 +1225,9 @@ export class Et2Dialog extends Et2Widget(SlotMixin(SlDialog)) } else { - senders.getRoot().getInstanceManager().submit(buttonId); + senders.clicked = true; + senders.getRoot().getInstanceManager().submit(button); + senders.clicked = false; } } };