Skip to content

Commit cd7dfbb

Browse files
authored
fix(frontend): Typing in the NodeKeyValueInput field causes the field to un-focus (Significant-Gravitas#8680)
* fix(frontend): Typing in the "Prompt Values" input field causes the field to un-focus * Add comment * Rephrase
1 parent a2895a2 commit cd7dfbb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

autogpt_platform/frontend/src/components/node-input-components.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,11 @@ const NodeKeyValueInput: FC<{
404404
>
405405
<div>
406406
{keyValuePairs.map(({ key, value }, index) => (
407-
<div key={getEntryKey(key)}>
407+
/*
408+
The `index` is used as a DOM key instead of the actual `key`
409+
because the `key` can change with each input, causing the input to lose focus.
410+
*/
411+
<div key={index}>
408412
<NodeHandle
409413
keyName={getEntryKey(key)}
410414
schema={{ type: "string" }}

0 commit comments

Comments
 (0)