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

Skip SelectEventPlugin extraction if no listeners #3639

Merged
merged 1 commit into from
Apr 9, 2015

Conversation

hellendag
Copy link

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.

@sophiebits
Copy link
Collaborator

Tests are failing:

>> not ok 88 - browser/eventPlugins/__tests__/SelectEventPlugin-test SelectEventPlugin should extract if an `onSelect` listener is present.
# Expected null not to be null.
# TypeError: 'null' is not an object (evaluating 'mouseup.type') in http://127.0.0.1:9999/test/index.html (line 79)

They're also super noisy because of a recent PR – I'll see if we can fix that separately.

@hellendag
Copy link
Author

Yeah, saw that. I'm fixing now.

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.
@sophiebits
Copy link
Collaborator

lgtm – merge at will.

hellendag pushed a commit that referenced this pull request Apr 9, 2015
Skip SelectEventPlugin extraction if no listeners
@hellendag hellendag merged commit 4ff99a2 into facebook:master Apr 9, 2015
@hellendag hellendag deleted the select-event-plugin branch April 9, 2015 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants