Skip to content

Commit 77158af

Browse files
committed
fix(webui): env vars editor loses focus on every keystroke
The environment variable key was used as the React key prop, so editing the key name caused React to unmount/remount the input on every character typed. Switched to array index as key — stable across edits. Confidence: high Scope-risk: narrow Tested: manual verification, tsc clean
1 parent 4d4459c commit 77158af

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

client/src/components/AgentConfigEditor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -548,8 +548,8 @@ function EnvVarsEditor({ env, onChange }: EnvVarsEditorProps) {
548548

549549
return (
550550
<div className="mt-2 space-y-2">
551-
{entries.map(([key, value]) => (
552-
<div key={key} className="flex items-center gap-2">
551+
{entries.map(([key, value], index) => (
552+
<div key={index} className="flex items-center gap-2">
553553
<Input
554554
value={key}
555555
onChange={(e) => updateEntry(key, e.target.value, value)}

0 commit comments

Comments
 (0)