fix: Escape closing parent modal when using overlayParentActions() (#19282)

This commit is contained in:
Wen RenHai
2026-02-19 10:12:26 +00:00
committed by GitHub
parent a32dd9efee
commit 47fc0f543e
3 changed files with 19 additions and 5 deletions
+4 -4
View File
File diff suppressed because one or more lines are too long
@@ -89,6 +89,20 @@ export default ({ id }) => ({
)
},
isTopmost() {
if (!id) {
return true
}
const openModals = document.querySelectorAll('.fi-modal-open')
if (openModals.length === 0) {
return false
}
return openModals[openModals.length - 1].id === id
},
close() {
this.closeQuietly()
@@ -140,7 +140,7 @@
>
<{{ filled($wireSubmitHandler) ? 'form' : 'div' }}
@if ($closeByEscaping)
x-on:keydown.window.escape="{{ $closeEventHandler }}"
x-on:keydown.window.escape="if (isTopmost()) {{ $closeEventHandler }}"
@endif
x-show="isWindowVisible"
x-transition:enter="fi-transition-enter"