Skip to content

Commit fbafadd

Browse files
fix(web): find shortcuts work while a panel button has focus
With focus on one of the panel's toggle buttons, Cmd+G did nothing and Cmd+F went to the browser. Only the panel's input handles its own keys now; its buttons get the same find shortcuts as the diff. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent b5071c4 commit fbafadd

2 files changed

Lines changed: 10 additions & 14 deletions

File tree

‎patches/@pierre%[email protected]‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ index 140f94f..96fc774 100644
330330
if (item.type === "diff") return item.instance.updateCodeViewLayout(item.item.fileDiff, item.top, void 0, item.item.annotations ?? []);
331331
diff --git a/dist/components/CodeViewSearch.js b/dist/components/CodeViewSearch.js
332332
new file mode 100644
333-
index 0000000..63d9d12
333+
index 0000000..29370ad
334334
--- /dev/null
335335
+++ b/dist/components/CodeViewSearch.js
336-
@@ -0,0 +1,364 @@
336+
@@ -0,0 +1,360 @@
337337
+import { isPrimaryModifier } from "../editor/platform.js";
338338
+import { resolveFindAgainShortcut } from "../editor/command.js";
339339
+import { SearchPanelWidget } from "../editor/searchPanel.js";
@@ -476,13 +476,9 @@ index 0000000..63d9d12
476476
+ }
477477
+ handleKeyDown = (event) => {
478478
+ if (event.isComposing || event.keyCode === 229) return;
479-
+ if (this.ownsEvent(event)) {
480-
+ if (event.key !== "Escape") return;
481-
+ event.stopPropagation();
482-
+ if (!isEditableTarget(event)) {
483-
+ event.preventDefault();
484-
+ this.close();
485-
+ }
479+
+ // The panel's inputs handle their own keys; its buttons get the shortcuts below.
480+
+ if (this.ownsEvent(event) && isEditableTarget(event)) {
481+
+ if (event.key === "Escape") event.stopPropagation();
486482
+ return;
487483
+ }
488484
+ if (event.defaultPrevented) return;

‎pnpm-lock.yaml‎

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)