diff --git a/contentcuration/contentcuration/frontend/shared/utils/testing.js b/contentcuration/contentcuration/frontend/shared/utils/testing.js index cc78737696..37c3e4cd45 100644 --- a/contentcuration/contentcuration/frontend/shared/utils/testing.js +++ b/contentcuration/contentcuration/frontend/shared/utils/testing.js @@ -25,3 +25,18 @@ export async function resetMockChannelScope() { Session.currentChannelId = Session._oldCurrentChannelId; delete Session._oldCurrentChannelId; } + +/** + * Tab into the component under test, entering backwards from a sentinel after it. + * + * Tabbing forward from the start of the document stops on the CSRF input the + * shared Jest setup leaves at the top of the body. + * + * @param {import('@testing-library/user-event').UserEvent} user + */ +export async function tabIn(user) { + const sentinel = document.body.appendChild(document.createElement('button')); + sentinel.focus(); + await user.tab({ shift: true }); + sentinel.remove(); +} diff --git a/contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/ClickableRegion/index.vue b/contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/ClickableRegion/index.vue index 7a0616624b..80ff7e1d42 100644 --- a/contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/ClickableRegion/index.vue +++ b/contentcuration/contentcuration/frontend/shared/views/QTIEditor/components/ClickableRegion/index.vue @@ -85,9 +85,11 @@ } } + /* No z-index: the stacking context it opens would trap the fixed toolbars and + popovers of an editor in the slot. Being positioned and later in the DOM + already paints this above the overlay button. */ .content-wrapper { position: relative; - z-index: 1; } diff --git a/contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue b/contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue index 0e114c49ea..bda590a756 100644 --- a/contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue +++ b/contentcuration/contentcuration/frontend/shared/views/TipTapEditor/TipTapEditor/TipTapEditor.vue @@ -13,6 +13,8 @@ :aria-label="editorMode === 'edit' ? TipTapEditorLabel$() : TipTapViewerLabel$()" aria-multiline="true" @keydown="handleContainerKeydown" + @focusin="hasFocusWithin = true" + @focusout="handleFocusout" >