|
|
@@ -180,7 +180,7 @@ function escapeKeyDown(e: KeyboardEvent) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function handerOpenAutoFocus(e: Event) {
|
|
|
+function handleOpenAutoFocus(e: Event) {
|
|
|
if (!openAutoFocus.value) {
|
|
|
e?.preventDefault();
|
|
|
}
|
|
|
@@ -209,6 +209,12 @@ const getForceMount = computed(() => {
|
|
|
return !unref(destroyOnClose) && unref(firstOpened);
|
|
|
});
|
|
|
|
|
|
+const handleOpened = () => {
|
|
|
+ requestAnimationFrame(() => {
|
|
|
+ props.modalApi?.onOpened();
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
function handleClosed() {
|
|
|
isClosed.value = true;
|
|
|
props.modalApi?.onClosed();
|
|
|
@@ -253,8 +259,8 @@ function handleClosed() {
|
|
|
@escape-key-down="escapeKeyDown"
|
|
|
@focus-outside="handleFocusOutside"
|
|
|
@interact-outside="interactOutside"
|
|
|
- @open-auto-focus="handerOpenAutoFocus"
|
|
|
- @opened="() => modalApi?.onOpened()"
|
|
|
+ @open-auto-focus="handleOpenAutoFocus"
|
|
|
+ @opened="handleOpened"
|
|
|
@pointer-down-outside="pointerDownOutside"
|
|
|
>
|
|
|
<DialogHeader
|