From bbc4a98fb93f78decec5e23879008279990050cf Mon Sep 17 00:00:00 2001 From: Sucukdeluxe <259325684+Sucukdeluxe@users.noreply.github.com> Date: Sat, 26 Sep 2026 05:21:22 +0200 Subject: [PATCH] Keep focus out of the hidden update dialog after closing 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. --- renderer/app.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/renderer/app.js b/renderer/app.js index 8cd05bd..88a2384 100644 --- a/renderer/app.js +++ b/renderer/app.js @@ -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(); + } } }