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
When using range input in React, the onChange event does not trigger properly under certain dynamic updates to its step and max attributes. Specifically, if the step and max values are updated dynamically, and the range input value is reset to 0, subsequent user interactions with the range slider fail to trigger the onChange event as expected. This behavior does not occur in a pure JavaScript implementation.
Click the middle of the range input, changing its value to 500.
Click the "Change to step 0.5 max 1" button, observe that the range input is set to 0 (expected behavior).
Click the "Change to step 500 max 1000" button, observe that the range input is set back to 0. Then click the middle of the range input.
The current behavior
After completing step 4, the value of the range input remains at 0, even though the user clicks on the middle of the range slider. The onChange event is not triggered, and the value does not update.
The expected behavior
After completing step 4, the value of the range input should update to 500 when the user clicks on the middle of the range slider. The onChange event should be triggered correctly, reflecting the value change.
Description
When using range input in React, the onChange event does not trigger properly under certain dynamic updates to its step and max attributes. Specifically, if the step and max values are updated dynamically, and the range input value is reset to 0, subsequent user interactions with the range slider fail to trigger the onChange event as expected. This behavior does not occur in a pure JavaScript implementation.
React version: 19.0.0
Steps To Reproduce
500
.0
(expected behavior).0
. Then click the middle of the range input.The current behavior
After completing step 4, the value of the range input remains at 0, even though the user clicks on the middle of the range slider. The onChange event is not triggered, and the value does not update.
The expected behavior
After completing step 4, the value of the range input should update to 500 when the user clicks on the middle of the range slider. The onChange event should be triggered correctly, reflecting the value change.
Link to code example
Screen.Recording.2025-01-23.at.7.24.24.PM.mov
The text was updated successfully, but these errors were encountered: