fix(frontend): Typing in the NodeKeyValueInput field causes the field to un-focus (#8680)

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

* Add comment

* Rephrase
This commit is contained in:
Zamil Majdy
2024-11-18 14:51:54 +04:00
committed by GitHub
parent a2895a2ca0
commit cd7dfbb8b3

View File

@@ -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" }}