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

Don't wrap drag events in IE/Edge in dev builds #6364

Merged
merged 1 commit into from
Apr 7, 2016

Conversation

p-jackson
Copy link
Contributor

Fix for #5700

Dev builds wrap synthetic events inside other events for a better debug experience. However IE/Edge won't allow access to the DataTransfer.dropEffect property if it's wrapped in this way.

DataTransfer objects can't be constructed by JavaScript, you can only use ones that the browser hands to you. So the first time a drag event is fired, we test if we're in an environment that behaves this way and disable React's improved development experience if we are.

Dev builds wrap synthetic events inside other events for a better debug
experience. However IE/Edge won't allow access to the
DataTransfer.dropEffect property if it's wrapped in this way.
The first time a drag event is fired, test if we're in an environment
that behaves this way and disable React's improved development
experience if we are.
@jimfb jimfb added this to the 15.x milestone Apr 1, 2016
@jimfb jimfb self-assigned this Apr 1, 2016
@jimfb jimfb merged commit 2e8f28c into facebook:master Apr 7, 2016
zpao pushed a commit that referenced this pull request May 10, 2016
Don't wrap drag events in IE/Edge in dev builds
(cherry picked from commit 2e8f28c)
@sophiebits
Copy link
Collaborator

sophiebits commented May 10, 2016

I'm going to revert this in #6741 – sorry I'm just seeing this now. ReactErrorUtils is a generic util and shouldn't know about SyntheticDragEvent, a DOM-specific concept. We should find a different fix for this.

@p-jackson
Copy link
Contributor Author

@spicyj Fair enough. How generic does ReactErrorUtils have to be? For instance, if SyntheticDragEvent had a flag on it along the lines of mustCheckIfEventCanBeWrapped = true then could ReactErrorUtils check for it? Or should it not even try guessing whether the first argument is an event.

@zpao zpao modified the milestones: 15.y.0, 15-next Jun 1, 2016
zpao pushed a commit to zpao/react that referenced this pull request Jun 8, 2016
Don't wrap drag events in IE/Edge in dev builds
(cherry picked from commit 2e8f28c)
@zpao zpao removed this from the 15-next milestone Jun 8, 2016
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.

5 participants