Skip to content

Commit

Permalink
fix(frontend) : Optional number input (#8940)
Browse files Browse the repository at this point in the history
- Resolve #8928 

Currently, the frontend renders a string input for an optional integer.
I have now corrected it.

![Screenshot 2024-12-11 at 10 23
48 AM](https://github.com/user-attachments/assets/a47eaf4c-97b0-458c-8a2c-fc66fdd0d770)
  • Loading branch information
Abhi1992002 authored Dec 11, 2024
1 parent 3fd2b7c commit b8a3ffc
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 b8a3ffc

Please sign in to comment.