Skip to content

Commit

Permalink
fix(NumberInput): zero min/max props (#2046)
Browse files Browse the repository at this point in the history
Co-authored-by: denis-vlasov <denis-vlasov@yandex-team.ru>
  • Loading branch information
wd055 and denis-vlasov authored Jan 16, 2025
1 parent dc42cff commit 255aa9d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/lab/NumberInput/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ export function getInternalState(props: VariablesProps): {
}
: {min: externalMin, max: externalMax};

const min = rangedMin && rangedMin >= Number.MIN_SAFE_INTEGER ? rangedMin : undefined;
const max = rangedMax && rangedMax <= Number.MAX_SAFE_INTEGER ? rangedMax : undefined;
const min =
rangedMin !== undefined && rangedMin >= Number.MIN_SAFE_INTEGER ? rangedMin : undefined;
const max =
rangedMax !== undefined && rangedMax <= Number.MAX_SAFE_INTEGER ? rangedMax : undefined;

const step = roundIfNecessary(Math.abs(externalStep), allowDecimal) || 1;
const shiftMultiplier = roundIfNecessary(externalShiftMultiplier, allowDecimal) || 10;
Expand Down

0 comments on commit 255aa9d

Please sign in to comment.