You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Julien Blatecky (JIRA)" <ji...@apache.org> on 2013/03/15 11:30:13 UTC

[jira] [Closed] (TAP5-2077) ElementWrapper#onevent jQuery implementation can return a wrong ElementWrapper

     [ https://issues.apache.org/jira/browse/TAP5-2077?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julien Blatecky closed TAP5-2077.
---------------------------------

    Resolution: Duplicate

TAP5-2060 seems to be more accurate than this issue.
                
> ElementWrapper#onevent jQuery implementation can return a wrong ElementWrapper
> ------------------------------------------------------------------------------
>
>                 Key: TAP5-2077
>                 URL: https://issues.apache.org/jira/browse/TAP5-2077
>             Project: Tapestry 5
>          Issue Type: Bug
>          Components: tapestry-core
>    Affects Versions: 5.4
>            Reporter: Julien Blatecky
>              Labels: dom, javascript, jquery, patch
>         Attachments: elementwrapper.onevent.patch
>
>
> Considers we bind an event on an element (<a> for example) and this element contains some other element (<span> for instance).
> The event that will be triggered returns an ElementWrapper wrapping the span element if we clicked on span, instead of returning a wrapped element of the <a> element.
> Consequently, in the case of a a[data-update-zone] containing some span or img elements, clicking on one of these elements raises a javascript error : "Attempt to wrap a null DOM element" when handling the callback.
> Indeed, in the wrapped callback (line 95 in the coffeescript jquery dom) the ElementWrapper is instantiated with the "event.target" returned by jquery, which is not the element on which we defined the event, but the deeper element on which the event occurs. jQuery.com says "The target property can be the element that registered for the event or a descendant of it.", whereas "this" will be "the current DOM element within the event bubbling phase." just like "event.currentTarget".

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira