From 6e7e144900231c13f25dcd97a8ca7d97042e4fcf Mon Sep 17 00:00:00 2001 From: Thomas Marstrander Date: Tue, 3 May 2016 11:15:21 +0200 Subject: [PATCH] Confirmation dialog - Focus confirm button on show. HFJ-1860 --- js/h5p-confirmation-dialog.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/js/h5p-confirmation-dialog.js b/js/h5p-confirmation-dialog.js index 15dd71e..01fa1d7 100644 --- a/js/h5p-confirmation-dialog.js +++ b/js/h5p-confirmation-dialog.js @@ -185,6 +185,9 @@ H5P.ConfirmationDialog = (function (EventDispatcher) { popup.classList.remove('hidden'); popupBackground.classList.remove('hiding'); + // Focus confirm button + confirmButton.focus(); + // Resize iFrame if necessary if (resizeIFrame && options.instance) { setTimeout(function () { @@ -198,10 +201,6 @@ H5P.ConfirmationDialog = (function (EventDispatcher) { }, 0); - // Programmatically focus popup - popup.setAttribute('tabindex', '-1'); - popup.focus(); - return this; };