The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 21:00 UTC
fix(web): preview address bar waits for the IME to finish before navigating (#34750)
Julius Marminge committed
Nov 11, 2026 at 21:00 UTC
ea22b5ffc7cfcb27a0170ebb20d80e0f7f26b122
2 files changed
+29
apps/web/src/components/preview/PreviewChromeRow.tsx
+5
@@ -167,6 +167,11 @@ export function PreviewChromeRow({
167
setInputFocused(false);
168
}}
169
onKeyDown={(event) => {
170
+ if (event.nativeEvent.isComposing || event.keyCode === 229) {
171
+ // A trusted Enter would still submit the form implicitly.
172
+ if (event.key === "Enter") event.preventDefault();
173
+ return;
174
+ }
175
if (event.key === "Enter") submit(event);
176
if (event.key === "Escape") {
177
event.preventDefault();
apps/web/src/components/preview/PreviewView.browser.test.tsx
+24
@@ -257,6 +257,30 @@ describe("PreviewView", () => {
257
},
258
);
259
260
+ it("keeps the address in the bar when Enter commits an IME composition", async () => {
261
+ setup();
262
+ await using _screen = await render(view());
263
+ const input = page.getByPlaceholder("Search or enter URL");
264
+ await input.fill("https://example.com/pinyin");
265
+
266
+ const enter = new KeyboardEvent("keydown", {
267
+ key: "Enter",
268
+ code: "Enter",
269
+ isComposing: true,
270
+ bubbles: true,
271
+ cancelable: true,
272
+ });
273
+ Object.defineProperty(enter, "keyCode", { value: 229 });
274
+ act(() => {
275
+ input.element().dispatchEvent(enter);
276
+ });
277
+
278
+ await expect.element(input).toHaveFocus();
279
+ await expect.element(input).toHaveValue("https://example.com/pinyin");
280
+ expect(mocks.navigate).not.toHaveBeenCalled();
281
+ expect(enter.defaultPrevented).toBe(true);
282
+ });
283
+
284
it("retains the annotation locally when its own environment loses access during capture", async () => {
285
setup();
286
const picked = annotation("annotation-revoked");