dillon1000/react

Commit

Skip SelectEventPlugin extraction if no listeners

If there are no listeners for `onSelect` yet, do not extract events. This way we can avoid issues where listeners have been set up for some event dependencies for `SelectEventPlugin`, but not all.

For instance, if `topMouseDown` has been registered but not `topMouseUp`, event extraction will set the `mouseDown` flag to true but never unset it. This leads to bugs when `onSelect` is registered and should be firing during normal key behavior. Since no `topMouseUp` has yet occurred to unset the flag, `onSelect` fails to fire.
Browse files
Changed paths2 files
First-parent comparison
M src/browser/eventPlugins/SelectEventPlugin.js ModifiedA src/browser/eventPlugins/__tests__/SelectEventPlugin-test.js Added
Patch

Files changed

Rendering syntax-highlighted changes…