You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The InputNumber component from PrimeReact triggers an infinite loop of calls to the onChange and onValueChange handlers when the value is decremented to 0. This behavior results in the following issues:
On Desktop:
The onChange handler functions correctly.
The onValueChange handler enters an infinite loop upon reaching 0.
On Mobile:
Both onChange and onValueChange handlers enter an infinite loop when the value is set to 0.
This issue appears to be related to the unmounting of the component and may involve improper cleanup of internal state or effects when the value reaches 0.
melloware
added
Type: Bug
Issue contains a defect related to a specific component.
and removed
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
labels
Oct 10, 2024
Describe the bug
The
InputNumber
component from PrimeReact triggers an infinite loop of calls to theonChange
andonValueChange
handlers when the value is decremented to 0. This behavior results in the following issues:On Desktop:
onChange
handler functions correctly.onValueChange
handler enters an infinite loop upon reaching 0.On Mobile:
onChange
andonValueChange
handlers enter an infinite loop when the value is set to 0.This issue appears to be related to the unmounting of the component and may involve improper cleanup of internal state or effects when the value reaches 0.
Reproducer
https://stackblitz.com/edit/vitejs-vite-zhutef
System Information
Steps to reproduce the behavior
InputNumber
component with an initial value of 2.onChange
functions correctly, butonValueChange
enters an infinite loop.onChange
andonValueChange
enter an infinite loop.Expected behavior
InputNumber
component should unmount without causing any infinite loops in theonChange
oronValueChange
handlers when the value is reduced to 0.onChange
andonValueChange
handlers should only be triggered once when the value changes, reflecting the current state without repeated calls.The text was updated successfully, but these errors were encountered: