Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions apps/web/src/components/ChatView.logic.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2180,6 +2180,10 @@ describe("shouldRefocusComposerOnWindowFocus", () => {
expect(shouldRefocusComposerOnWindowFocus(element("DIV", { role: "textbox" }))).toBe(false);
});

it.each(["IFRAME", "WEBVIEW"])("leaves a focused %s preview alone", (tagName) => {
expect(shouldRefocusComposerOnWindowFocus(element(tagName))).toBe(false);
});

it("leaves a focused terminal alone in the drawer and the right panel", () => {
expect(
shouldRefocusComposerOnWindowFocus(element("BUTTON", { within: "data-terminal-owner" })),
Expand Down
2 changes: 2 additions & 0 deletions apps/web/src/components/ChatView.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1350,6 +1350,8 @@ export function shouldRefocusComposerOnWindowFocus(
activeElement.tagName === "INPUT" ||
activeElement.tagName === "TEXTAREA" ||
activeElement.tagName === "SELECT" ||
activeElement.tagName === "IFRAME" ||
activeElement.tagName === "WEBVIEW" ||
activeElement.isContentEditable === true ||
activeElement.getAttribute("role") === "textbox"
) {
Expand Down
Loading