فینورا پرو - سامانه جامع حسابداری و صدور فاکتور

fix(ux): make modal Escape respect configured shortcuts while dismissing only the top nested dialog

davoodmehraban89 committed Oct 30, 2026 at 23:35 UTC ac5a93042a09e6a388855a20e214c6aa27b37b96
1 file changed +4
src/core/Modal.js
+4
@@ -21,6 +21,10 @@ class ModalManager {
21 const top = this.stack[this.stack.length - 1];
22 if (!top) return;
23 if (event.key === 'Escape') {
24 + // Respect the user's keyboard setting. When enabled, this is the
25 + // single owner of Escape for stacked dialogs; close only the top one.
26 + const shortcuts = window.KeyboardShortcuts?.settings;
27 + if (shortcuts?.enabled && shortcuts.escapeCloses === false) return;
28 event.preventDefault();
29 event.stopPropagation();
30 this.close();