Programmatically set focus to confirmation dialog.

HFJ-1572
pull/18/head
Thomas Marstrander 2016-04-08 10:23:55 +02:00
parent e8adccaa02
commit 233b5e7653
2 changed files with 8 additions and 1 deletions

View File

@ -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;
};

View File

@ -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;