Skip to content

Commit

Permalink
Hotfix: Fixed number inputs sometimes being NaN
Browse files Browse the repository at this point in the history
Bump version
  • Loading branch information
joeyballentine committed Jan 21, 2022
1 parent a23dce4 commit fd10e25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chainner",
"productName": "chaiNNer",
"version": "0.1.3",
"version": "0.1.4",
"description": "A flowchart based image processing GUI",
"main": ".webpack/main",
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/components/inputs/NumberInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ const NumericalInput = memo(({
const handleChange = (numberAsString, numberAsNumber) => {
if (data?.inputs[index]?.type.includes('odd')) {
// Make the number odd if need be
setInput(numberAsNumber + (1 - (numberAsNumber % 2)));
setInput(String(numberAsNumber + (1 - (numberAsNumber % 2))));
} else {
setInput(numberAsNumber);
setInput(numberAsString);
}
};

Expand All @@ -32,7 +32,7 @@ const NumericalInput = memo(({
max={max ?? Infinity}
precision={precision}
placeholder={label}
value={input}
value={String(input) || 0}
onChange={handleChange}
draggable={false}
className="nodrag"
Expand Down

0 comments on commit fd10e25

Please sign in to comment.