From 6fd62172e6b24667a9f70e8e48ae4de0494d0cd8 Mon Sep 17 00:00:00 2001 From: Darshan-upadhyay1110 Date: Mon, 4 Nov 2024 18:40:08 +0530 Subject: [PATCH] We need to change focus to last active element in case of "clearDialog" Problem: - in case of submenu (for example in Calc there is a conditional format menu ) - when we open submenu it and then press ESC it changes focus back to document - and the main parent menu stays open without focus Solution: - call LastElement focus before Clear dialog so it works as expected (MSO does the same) Signed-off-by: Darshan-upadhyay1110 Change-Id: Ic8fa988f3a8854a99c44d0fde5a7dec32e398739 --- browser/src/control/Control.JSDialog.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browser/src/control/Control.JSDialog.js b/browser/src/control/Control.JSDialog.js index dd181b9161ec..42e0f57bc535 100644 --- a/browser/src/control/Control.JSDialog.js +++ b/browser/src/control/Control.JSDialog.js @@ -145,7 +145,10 @@ L.Control.JSDialog = L.Control.extend({ console.warn('closePopover: no builder'); } else { + // Need to change focus to last element before we clear the current dialog + this.focusToLastElement(id); this.clearDialog(id); + return; } this.focusToLastElement(id);