一部のmodalのフォーカストラップが外れない問題を修正

This commit is contained in:
kakkokari-gtyih 2024-07-09 23:16:16 +09:00
parent 93b2b9818a
commit 8f602b7656
1 changed files with 6 additions and 1 deletions

View File

@ -30,7 +30,7 @@ SPDX-License-Identifier: AGPL-3.0-only
[$style.transition_modal_leaveTo]: transitionName === 'modal',
[$style.transition_send_leaveTo]: transitionName === 'send',
})"
:duration="transitionDuration" appear @afterLeave="emit('closed')" @enter="emit('opening')" @afterEnter="onOpened"
:duration="transitionDuration" appear @afterLeave="onClosed" @enter="emit('opening')" @afterEnter="onOpened"
>
<div v-show="manualShowing != null ? manualShowing : showing" ref="modalRootEl" v-hotkey.global="keymap" :class="[$style.root, { [$style.drawer]: type === 'drawer', [$style.dialog]: type === 'dialog', [$style.popup]: type === 'popup' }]" :style="{ zIndex, pointerEvents: (manualShowing != null ? manualShowing : showing) ? 'auto' : 'none', '--transformOrigin': transformOrigin }">
<div data-cy-bg :data-cy-transparent="isEnableBgTransparent" class="_modalBg" :class="[$style.bg, { [$style.bgTransparent]: isEnableBgTransparent }]" :style="{ zIndex }" @click="onBgClick" @mousedown="onBgClick" @contextmenu.prevent.stop="() => {}"></div>
@ -307,6 +307,11 @@ const onOpened = () => {
}, { passive: true });
};
const onClosed = () => {
releaseFocusTrap?.();
emit('closed');
};
const alignObserver = new ResizeObserver((entries, observer) => {
align();
});