Skip to content

Commit

Permalink
Allow number inputs to contain empty strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tacodiva committed Aug 28, 2023
1 parent e2f7aa0 commit 95e3611
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions addons/middle-click-popup/BlockTypeInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ export class BlockInputNumber extends BlockInputRound {
const type = typeof value;
if (type === "number") return value;
if (type === "string") {
if (value.length === 0) return value;
const number = parseFloat(value);
if (isNaN(number)) throw new Error('Cannot set numeric type input to string "' + value + '".');
return value;
Expand Down

0 comments on commit 95e3611

Please sign in to comment.