From f80861fbe29dde5c09d10f52c5df5fbaf281b7af Mon Sep 17 00:00:00 2001 From: yflory Date: Mon, 13 Oct 2025 14:24:40 +0200 Subject: [PATCH] Fix OO document not editable after collapsing toolbar #2065 --- www/common/toolbar.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/www/common/toolbar.js b/www/common/toolbar.js index a8ba79c92..c413e548f 100644 --- a/www/common/toolbar.js +++ b/www/common/toolbar.js @@ -519,6 +519,12 @@ MessengerUI, Messages, Pages, PadTypes) { toolbar.$bottomR.prepend($button); $down.hide(); $(notif).hide(); + + let focus; + $button.on('mousedown', function () { + focus = document.activeElement; + }); + $button.click(function () { toolbar.$top.toggleClass('toolbar-hidden'); var hidden = toolbar.$top.hasClass('toolbar-hidden'); @@ -531,6 +537,15 @@ MessengerUI, Messages, Pages, PadTypes) { $down.hide(); $(notif).hide(); } + + // Fix focus + $button.focus(); + if (focus.nodeName === "IFRAME") { + $(focus.contentWindow).focus(); + } else { + $(focus).focus(); + } + }); };