diff --git a/js/h5p-confirmation-dialog.js b/js/h5p-confirmation-dialog.js index b631c0c..3263b76 100644 --- a/js/h5p-confirmation-dialog.js +++ b/js/h5p-confirmation-dialog.js @@ -176,7 +176,10 @@ H5P.ConfirmationDialog = (function (EventDispatcher) { fitToContainer(); popupBackground.classList.remove('hiding'); popup.classList.remove('hidden'); - cancelButton.focus(); + + // Programmatically focus popup + popup.setAttribute('tabindex', '-1'); + popup.focus(); return this; }; diff --git a/styles/h5p-confirmation-dialog.css b/styles/h5p-confirmation-dialog.css index 8b9fedd..05e3a3f 100644 --- a/styles/h5p-confirmation-dialog.css +++ b/styles/h5p-confirmation-dialog.css @@ -25,6 +25,10 @@ transition: opacity 0.1s linear 0s, visibility 0s linear 0.1s; } +.h5p-confirmation-dialog-popup:focus { + outline: none; +} + .h5p-confirmation-dialog-popup { position: absolute; display: flex;