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
Do you want to request a feature or report a bug? bug
What is the current behavior?
When React component is mounted as a descendent of DOM element which stops propagation of change event, onChange event of <select> in React component does not occur.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
React binds events at the document level. You're experiencing this for selects specifically because React actually uses the change browser event for selects. For inputs and textarea, it currently uses the input event. So you can see the same exact issue with inputs if you "block" the input event.
I think we can close this as a duplicate of #2043 (which would solve this).
Do you want to request a feature or report a bug? bug
What is the current behavior?
When React component is mounted as a descendent of DOM element which stops propagation of
change
event,onChange
event of<select>
in React component does not occur.If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.
HTML structure
React Component (only
render()
)Reproduction in CodePen
What is the expected behavior?
<select onChange>
works well just like<input>
or<textarea>
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
This issue occurred with React 16.4.2 (not tested for older React), newest Chrome, Firefox, Edge, IE11 on Windows 10.
The text was updated successfully, but these errors were encountered: