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
After typing some characters into the input, the input event listener is triggered, changing the target.value property. However, for some reason, the onChange prop is not being triggered. If we comment out the line that changes the target.value, both listeners are triggered as expected.
Expected Behavior
The onChange prop should be triggered after the input event listener changes the target.value property.
The text was updated successfully, but these errors were encountered:
timbo-dev
changed the title
Bug: onChange is not trigged when the 'input' event listener changes the target's value.
Bug: onChange is not triggered when the 'input' event listener changes the target's value.
May 9, 2024
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!
React version: 18.3.1
Steps To Reproduce
onChange
prop.useRef
to get the input.useEffect
call, add an event listener with "input" as the listener.onChange
prop will not be triggered.Link to code example
Vanilla JavaScript example
Current Behavior
After typing some characters into the input, the
input
event listener is triggered, changing thetarget.value
property. However, for some reason, theonChange
prop is not being triggered. If we comment out the line that changes thetarget.value
, both listeners are triggered as expected.Expected Behavior
The
onChange
prop should be triggered after theinput
event listener changes thetarget.value
property.The text was updated successfully, but these errors were encountered: