mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
fix: Escape closing parent modal when using overlayParentActions() (#19282)
This commit is contained in:
Vendored
+4
-4
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"
|
||||
|
||||
Reference in New Issue
Block a user