Skip to content

Commit

Permalink
Fix #5245: InputNumber prevent infinite loop (#5249)
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware authored Nov 6, 2023
1 parent ef81d79 commit 432ec35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/lib/inputnumber/InputNumber.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 432ec35

Please sign in to comment.