fix(frontend): すでにfocus trap対象の要素にinertがかかっている場合は解除するように (#14189)

* fix(frontend): すでにfocus trap対象の要素にinertがかかっている場合は解除するように

* 他のfocus-trapped要素とのインタラクションがある場合の動作を変更

* typo
This commit is contained in:
かっこかり
2024-07-13 13:02:27 +09:00
committed by GitHub
parent 91de35ecdf
commit 1b175ea759
3 changed files with 22 additions and 6 deletions

View File

@@ -71,6 +71,7 @@ const props = withDefaults(defineProps<{
zPriority?: 'low' | 'middle' | 'high';
noOverlap?: boolean;
transparentBg?: boolean;
hasInteractionWithOtherFocusTrappedEls?: boolean;
returnFocusTo?: HTMLElement | null;
}>(), {
manualShowing: null,
@@ -80,6 +81,7 @@ const props = withDefaults(defineProps<{
zPriority: 'low',
noOverlap: true,
transparentBg: false,
hasInteractionWithOtherFocusTrappedEls: false,
returnFocusTo: null,
});
@@ -326,7 +328,7 @@ onMounted(() => {
watch([showing, () => props.manualShowing], ([showing, manualShowing]) => {
if (manualShowing === true || (manualShowing == null && showing === true)) {
if (modalRootEl.value != null) {
const { release } = focusTrap(modalRootEl.value);
const { release } = focusTrap(modalRootEl.value, props.hasInteractionWithOtherFocusTrappedEls);
releaseFocusTrap = release;
modalRootEl.value.focus();