CustomEvent detail property not copied to Event object
#1867
Comments
|
Thanks for the report! Could you create a minimal example on Michał Gołębiowski |
|
Example here: http://jsbin.com/padibumefo/1/edit?html,console,output |
|
There seem to be two documented properties that are not copied, Because of the overhead of copying properties, I'm hesitant to add |
|
I had this same problem recently in a project, where I initially assumed the property was present. After some thought I realized jQuery already have a custom way to handle this using the In other hand, the callback is not portable between native and jQuery-based environments. |
|
Any property not normalized by jQuery can be accessed via |
|
As I mentioned, in my case in particular the only problem was the code portability. When I ported the event handling callback from another codebase I initially expected it would work without changes in a jQuery environment using the ui widget factory. What happened instead is that I had to change It is not a big deal though if performance is an issue. Updating the docs seems reasonable. |
|
Per discussion in the meeting today, let's add |
|
Any chance to get this fix in the stable branches? |
|
Is there a problem using |
|
Not really - just have to make sure we always use jquery for attaching events. |
According to the documentation (or at least how I interpret it), the
detailproperty is copied to the event object when it is present (i.e. when the event is aCustomEvent). However, this does not seem to be the case (I tried accessing it, and i don't see any reference todetailin the code either, it's not listed in anypropslist inevent.js).My workaround is to go through
originalEvent.detail, but it would be nice if jQuery copied this property.The text was updated successfully, but these errors were encountered: