From 432ec3518651b179ff8aced3ae8b58f719b30700 Mon Sep 17 00:00:00 2001 From: Melloware Date: Mon, 6 Nov 2023 08:52:03 -0500 Subject: [PATCH] Fix #5245: InputNumber prevent infinite loop (#5249) --- components/lib/inputnumber/InputNumber.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/components/lib/inputnumber/InputNumber.js b/components/lib/inputnumber/InputNumber.js index 6845493335..04a011e37f 100644 --- a/components/lib/inputnumber/InputNumber.js +++ b/components/lib/inputnumber/InputNumber.js @@ -1028,6 +1028,13 @@ export const InputNumber = React.memo( changeValue(); }, [props.value]); + useUpdateEffect(() => { + // #5245 prevent infinite loop + if (props.disabled) { + clearTimer(); + } + }, [props.disabled]); + const createInputElement = () => { const className = classNames('p-inputnumber-input', props.inputClassName); const valueToRender = formattedValue(props.value);