authorgravatar for lucenz@proton.meSimone <lucenz@proton.me> 2026-09-12 22:45:55+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-09-12 17:45:55-03:00
logcfeaca41ae27bdf2c203158d378c87c7308fea2a
tree69fd214706f03f2ea6dcd4240830118d060c197c
parent3486451525ecaf3a8379aa6d08c885c7cc5335e3
signature Signed by PGP key B5690EEEBB952194

fix(web): preserve preview focus on window return (#11444)

Co-authored-by: Simone <185146821+Lucenx9@users.noreply.github.com>

2 files changed, 6 insertions(+), 0 deletions(-)

apps/web/src/components/ChatView.logic.test.ts+4
......@@ -2180,6 +2180,10 @@ describe("shouldRefocusComposerOnWindowFocus", () => {
21802180 expect(shouldRefocusComposerOnWindowFocus(element("DIV", { role: "textbox" }))).toBe(false);
21812181 });
21822182
2183 it.each(["IFRAME", "WEBVIEW"])("leaves a focused %s preview alone", (tagName) => {
2184 expect(shouldRefocusComposerOnWindowFocus(element(tagName))).toBe(false);
2185 });
2186
21832187 it("leaves a focused terminal alone in the drawer and the right panel", () => {
21842188 expect(
21852189 shouldRefocusComposerOnWindowFocus(element("BUTTON", { within: "data-terminal-owner" })),
apps/web/src/components/ChatView.logic.ts+2
......@@ -1350,6 +1350,8 @@ export function shouldRefocusComposerOnWindowFocus(
13501350 activeElement.tagName === "INPUT" ||
13511351 activeElement.tagName === "TEXTAREA" ||
13521352 activeElement.tagName === "SELECT" ||
1353 activeElement.tagName === "IFRAME" ||
1354 activeElement.tagName === "WEBVIEW" ||
13531355 activeElement.isContentEditable === true ||
13541356 activeElement.getAttribute("role") === "textbox"
13551357 ) {