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,
}) => {
const {range} = config
if (range) {
if (range && !range.includes(Infinity) && !range.includes(-Infinity)) {
return (
deltaFraction * (range[1] - range[0]) * magnitude * config.nudgeMultiplier
)