Skip to content

Commit 2364938

Browse files
committed
VA-523 allow navigate back to close button
1 parent 2ab6de2 commit 2364938

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/scripts/h5p-multi-media-choice-option.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ export class MultiMediaChoiceOption {
268268
closeButton.addEventListener('click', closeModal);
269269

270270
// Add elements that should be tabbable is in this list
271-
const focusableElements = modal.querySelectorAll('.h5p-video, button:not([disabled])');
271+
const focusableElements = modal.querySelectorAll('.h5p-video, button:not([disabled])');
272272
const firstFocusable = focusableElements[0];
273273
const lastFocusable = focusableElements[focusableElements.length - 1];
274274

@@ -281,8 +281,9 @@ export class MultiMediaChoiceOption {
281281
// make choice options unavailable from tabs
282282
if (document.activeElement != firstFocusable && document.activeElement != lastFocusable) {
283283
firstFocusable.focus();
284+
event.preventDefault();
284285
}
285-
if ( event.shiftKey ) /* shift + tab */ {
286+
else if ( event.shiftKey ) /* shift + tab */ {
286287
if (document.activeElement === firstFocusable) {
287288
lastFocusable.focus();
288289
event.preventDefault();

0 commit comments

Comments
 (0)