Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: onChange is not triggered when the 'input' event listener changes the target's value. #29036

Open
timbo-dev opened this issue May 9, 2024 · 4 comments
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug

Comments

@timbo-dev
Copy link

timbo-dev commented May 9, 2024

React version: 18.3.1

Steps To Reproduce

  1. Create a root component.
  2. Insert an input tag that contains an onChange prop.
  3. Call useRef to get the input.
  4. In a useEffect call, add an event listener with "input" as the listener.
  5. Observe how the 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 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.

@timbo-dev timbo-dev added the Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug label May 9, 2024
@timbo-dev 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
@purvish-dhameliya
Copy link

assign to me

@timbo-dev
Copy link
Author

@purvish-dhameliya I don't have permissions for it.

Copy link

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!

@github-actions github-actions bot added the Resolution: Stale Automatically closed due to inactivity label Aug 16, 2024
@timbo-dev
Copy link
Author

bump

@github-actions github-actions bot removed the Resolution: Stale Automatically closed due to inactivity label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Unconfirmed A potential issue that we haven't yet confirmed as a bug
Projects
None yet
Development

No branches or pull requests

2 participants