Skip to content

Commit

Permalink
fix optional number input
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhi1992002 committed Dec 11, 2024
1 parent 6307ca1 commit 8a5b31d
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,21 @@ export const NodeGenericInputField: FC<{
handleInputClick={handleInputClick}
/>
);
} else if (
(types.includes("integer") || types.includes("number")) &&
types.includes("null")
) {
return (
<NodeNumberInput
selfKey={propKey}
schema={{ ...propSchema, type: "integer" } as BlockIONumberSubSchema}
value={currentValue}
error={errors[propKey]}
className={className}
displayName={displayName}
handleInputChange={handleInputChange}
/>
);
}
}

Expand Down Expand Up @@ -541,7 +556,7 @@ const NodeKeyValueInput: FC<{
>
<div>
{keyValuePairs.map(({ key, value }, index) => (
/*
/*
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.
*/
Expand Down

0 comments on commit 8a5b31d

Please sign in to comment.