Skip to content

Commit e7bd15d

Browse files
committed
🤖 fix: stop Escape propagation in Settings edit inputs
Prevents Escape from closing the modal when canceling inline edits. Also disables spellcheck on MCP command input.
1 parent 75984fc commit e7bd15d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

src/browser/components/Settings/sections/ModelRow.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ export function ModelRow(props: ModelRowProps) {
4747
onChange={(e) => props.onEditChange?.(e.target.value)}
4848
onKeyDown={(e) => {
4949
if (e.key === "Enter") props.onSaveEdit?.();
50-
if (e.key === "Escape") props.onCancelEdit?.();
50+
if (e.key === "Escape") {
51+
e.stopPropagation();
52+
props.onCancelEdit?.();
53+
}
5154
}}
5255
className="bg-modal-bg border-border-medium focus:border-accent min-w-0 flex-1 rounded border px-2 py-0.5 font-mono text-xs focus:outline-none"
5356
autoFocus

src/browser/components/Settings/sections/ProjectSettingsSection.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,12 @@ export const ProjectSettingsSection: React.FC = () => {
295295
onChange={(e) => setEditCommand(e.target.value)}
296296
className="border-border-medium bg-secondary/30 text-foreground placeholder:text-muted-foreground focus:ring-accent mt-1 w-full rounded-md border px-2 py-1 text-xs focus:ring-1 focus:outline-none"
297297
autoFocus
298+
spellCheck={false}
298299
onKeyDown={(e) => {
299300
if (e.key === "Enter") {
300301
void handleSaveEdit();
301302
} else if (e.key === "Escape") {
303+
e.stopPropagation();
302304
handleCancelEdit();
303305
}
304306
}}

src/browser/components/Settings/sections/ProvidersSection.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ export function ProvidersSection() {
264264
autoFocus
265265
onKeyDown={(e) => {
266266
if (e.key === "Enter") handleSaveEdit();
267-
if (e.key === "Escape") handleCancelEdit();
267+
if (e.key === "Escape") {
268+
e.stopPropagation();
269+
handleCancelEdit();
270+
}
268271
}}
269272
/>
270273
<Button

0 commit comments

Comments
 (0)