From 455ac7736df49dde5ca6a5eb42fb1beee03fb69c Mon Sep 17 00:00:00 2001 From: Andrew Prifer <2991360+AndrewPrifer@users.noreply.github.com> Date: Wed, 26 Oct 2022 19:26:19 +0200 Subject: [PATCH] Fix default number nudge funcion (#328) Fix default number nudge function --- theatre/core/src/propTypes/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/theatre/core/src/propTypes/index.ts b/theatre/core/src/propTypes/index.ts index d152388..9a8c3dd 100644 --- a/theatre/core/src/propTypes/index.ts +++ b/theatre/core/src/propTypes/index.ts @@ -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 )