dillon1000/react
Commit
Browse files Use the virtual target for change events to avoid restoring controlled state on the real target (#10444)
* Add test for nested controlled selects The failure repros only when two events are fired sequentially, where the second event is what updates the value. * Add failure case to DOM select fixture * Use virtual event target for change event instead of native target Ensures that we use the same node to make decisions instead of two like we do now. This will cause restore to be called or not called consistently. * Pass native event target to the event We normally pass the native event target to the event object. This ensures that we do the same thing here. We still want to schedule a "restore" on the virtual target though since those are the only nodes known to React.
Changed paths3 files
First-parent comparisonfixtures/dom/src/components/fixtures/selects/index.js ModifiedM src/renderers/dom/shared/eventPlugins/ChangeEventPlugin.js ModifiedM src/renderers/dom/shared/wrappers/__tests__/ReactDOMSelect-test.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…