Charles Capon created TAP5-2380:
-----------------------------------

             Summary: [JavaScript][t5/core/dom] missused target on eventlink
                 Key: TAP5-2380
                 URL: https://issues.apache.org/jira/browse/TAP5-2380
             Project: Tapestry 5
          Issue Type: Bug
          Components: tapestry-core
    Affects Versions: 5.4
            Reporter: Charles Capon


Setup: t5.4-beta-15 with jquery only.

I used an EventLink like this :

{code:xml}
<t:eventlink t:event="saveATree" async="true" id="saveButton" class="btn 
btn-success">
    <span class="fa fa-tree" />
    <span class="hidden-xs hidden-sm">Sauver un arbre</span>
</t:eventlink>
{code}

I think i got it right because it works when I click on it until I precisely 
click on the icon or the text. Then, it doesn't call the url I want it to.

I debugged the js code and it appears that in the jquery.event, the property 
target is the actual clicked element (in my example, the span). So when the 
callback is called, this equal to my span element and does not contain any href 
attribute.

I can't provide a patch but the fix is quite simple... you just need to use the 
currentTarget property instead of target in the event wrapper (line 148 in 
t5-core-dom.coffee). I also think that it should be easy to write a test for 
this bug.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to