Fix default number nudge funcion (#328)

Fix default number nudge function
This commit is contained in:
Andrew Prifer 2022-10-26 19:26:19 +02:00 committed by GitHub
parent 43714fdf17
commit 455ac7736d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -651,7 +651,7 @@ const defaultNumberNudgeFn: NumberNudgeFn = ({
magnitude, magnitude,
}) => { }) => {
const {range} = config const {range} = config
if (range) { if (range && !range.includes(Infinity) && !range.includes(-Infinity)) {
return ( return (
deltaFraction * (range[1] - range[0]) * magnitude * config.nudgeMultiplier deltaFraction * (range[1] - range[0]) * magnitude * config.nudgeMultiplier
) )