-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Drag and drop events on views do not have e.dataTransfer #1073
Comments
@juliangutman Can you be a little more specific about what you are suggesting? It seems that the data you need can be accessed via |
Fair point, it could be done that way. I was simply suggesting that considering that the drag and drop series of events were the only ones for which a crucial event property was not available on the augmented jQuery event object, it might make sense to add: jQuery.event.props.push("dataTransfer"); somewhere in the ember source. If not, at least have a note in the api docs around the fact that dataTransfer needs to be accessed via the originalEvent. I spent a bit of time and frustration trying to understand why I couldn't get the dataTransfer property and only after looking through the jQuery documentation did I find that section and luckily the example included the dataTransfer property specifically. |
Looks like there is a way to get html5 event attributes copied over by jQuery with less of a performance hit. If you push directly onto Instead, you can add per-event via Consider this example, where And these discussions: http://bugs.jquery.com/ticket/5249 so for extra events and properties we want to support, we'd add something like this:
|
Very awesome. Appreciate you looking into this and sending over the Julian On Jun 26, 2012, at 12:31 AM, raycohen
|
ping: @wagenet Since the event delegator is handling drag & drop events, this would be handy. Thoughts? |
@raycohen Since you seem to be fairly familiar with how this should work is this something you'd be willing to attempt a PR for? |
Sure, I'd be glad to give it a shot. On Tuesday, June 26, 2012 at 1:08 AM, Peter Wagenet wrote:
|
Is it ok for the code (and the tests) to check the existence of I'm also a bit concerned that fixHooks is not documented as part of the public API for jQuery. |
I think we can bump to requiring 1.7 for master so this fix should probably target master then. Maybe @wycats can provide some insight about |
|
Can someone submit a pull request that uses fixHooks and bumps us to 1.7? |
This has been merged it looks like. |
…g cleanup). Changelog from the release: * `@glimmer/integration-tests`, `@glimmer/interfaces`, `@glimmer/runtime` * [#1073](glimmerjs/glimmer-vm#1073) Ensure errors during component creation do not cause secondary errors during DOM cleanup ([@pzuraq](https://github.com/pzuraq)) - Chris Garrett ([@pzuraq](https://github.com/pzuraq))
…g cleanup). Changelog from the release: * `@glimmer/integration-tests`, `@glimmer/interfaces`, `@glimmer/runtime` * [#1073](glimmerjs/glimmer-vm#1073) Ensure errors during component creation do not cause secondary errors during DOM cleanup ([@pzuraq](https://github.com/pzuraq)) - Chris Garrett ([@pzuraq](https://github.com/pzuraq)) (cherry picked from commit cf4a4bc)
The html5 drag and drop events on views do not have the dataTransfer property on the event object. Likely because jQuery does not in its default state copy that property to the jQuery event from the browser event.
As per the jQuery documentation:
OtherProperties
Certain events may have properties specific to them. Those can be accessed as properties of the event.originalEvent object. To make special properties available in all event objects, they can be added to the jQuery.event.props array. This is not recommended, since it adds overhead to every event delivered by jQuery.
Example:
// add the dataTransfer property for use with the native
drop
event// to capture information about files dropped into the browser window
jQuery.event.props.push("dataTransfer");
The text was updated successfully, but these errors were encountered: