Skip to content

Commit

Permalink
fix(frontend): Typing in the NodeKeyValueInput field causes the field…
Browse files Browse the repository at this point in the history
… to un-focus (#8680)

* fix(frontend): Typing in the "Prompt Values" input field causes the field to un-focus

* Add comment

* Rephrase
  • Loading branch information
majdyz authored Nov 18, 2024
1 parent a2895a2 commit cd7dfbb
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,11 @@ const NodeKeyValueInput: FC<{
>
<div>
{keyValuePairs.map(({ key, value }, index) => (
<div key={getEntryKey(key)}>
/*
The `index` is used as a DOM key instead of the actual `key`
because the `key` can change with each input, causing the input to lose focus.
*/
<div key={index}>
<NodeHandle
keyName={getEntryKey(key)}
schema={{ type: "string" }}
Expand Down

0 comments on commit cd7dfbb

Please sign in to comment.