When the dialog was opened without a usable focus target, closing it left keyboard focus on a button inside the hidden overlay. Fall back to the header update action, or clear focus when that is not available.
This commit is contained in:
1 parent
5157655354
commit
bbc4a98fb9
1 file changed
+6
-1
+6
-1
@@ -9750,7 +9750,12 @@ function _setUpdateDialogVisible(visible) {
|
||||
_setUpdateBackgroundInert(false);
|
||||
const returnFocus = _updateDialogReturnFocus;
|
||||
_updateDialogReturnFocus = null;
|
||||
if (returnFocus && returnFocus.isConnected && typeof returnFocus.focus === 'function') returnFocus.focus();
|
||||
if (returnFocus && returnFocus !== document.body && returnFocus.isConnected && typeof returnFocus.focus === 'function') returnFocus.focus();
|
||||
if (overlay.contains(document.activeElement)) {
|
||||
const headerButton = document.getElementById('headerUpdateBtn');
|
||||
if (headerButton && !headerButton.disabled && headerButton.getClientRects().length > 0) headerButton.focus();
|
||||
if (overlay.contains(document.activeElement)) document.activeElement.blur();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user