Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 34b1a18

Browse files
committed
Blur the element that had focus instead of giving focus to the dialog when we can't focus a button
1 parent 9f84d45 commit 34b1a18

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/widgets/Dialogs.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ define(function (require, exports, module) {
297297
promise = result.promise(),
298298
$dlg = $(template)
299299
.addClass("instance")
300-
.prop("tabindex", "-1")
301300
.appendTo(".modal-inner-wrapper:last");
302301

303302
// Don't allow dialog to exceed viewport size
@@ -343,7 +342,7 @@ define(function (require, exports, module) {
343342
} else if ($otherBtn.length) {
344343
$otherBtn.focus();
345344
} else {
346-
$dlg.focus();
345+
document.activeElement.blur();
347346
}
348347

349348
// Push our global keydown handler onto the global stack of handlers.

0 commit comments

Comments
 (0)