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

Serge Huber updated UNOMI-1046:
-------------------------------
    Description: 
On a button or other element that does not leave the page, whose clicks are 
sent with sendClickEvent, the site's own click handlers ran twice for each 
click: a toggle switched back, a counter counted double, a menu opened and 
closed.

Cause: once the event was sent, the tracker dispatched the click again on the 
element, and that copy reached all the page's listeners.

Fix: clicks on elements that do not leave the page are no longer held back nor 
dispatched again; the event is just sent. Clicks on links and submit buttons 
are still held back until the event is sent, then dispatched again to the whole 
page as before, so that routers of single-page applications handle them. 
Covered by browser tests against each Unomi server.

  was:
On a button or link whose clicks are sent with sendClickEvent, the site's own 
click handlers run twice for each click: a toggle switches back, a counter 
counts double, a menu opens and closes.

Cause: once the event is sent, the tracker dispatches the click again on the 
element so that its default action happens (following the link, submitting the 
form), and that copy also reaches all the page's listeners.

Fix: the copy is stopped before it reaches the page's listeners. Stopping it 
does not cancel the default action, so the link is still followed and the form 
still submitted. Covered by browser tests against each Unomi server (button and 
link: the site's handler runs once per click).


> Tracker: the site's own click handlers run twice on an element tracked with 
> sendClickEvent
> ------------------------------------------------------------------------------------------
>
>                 Key: UNOMI-1046
>                 URL: https://issues.apache.org/jira/browse/UNOMI-1046
>             Project: Apache Unomi
>          Issue Type: Sub-task
>          Components: unomi-tracker
>            Reporter: Serge Huber
>            Assignee: Serge Huber
>            Priority: Major
>             Fix For: unomi-tracker-1.6.0, unomi-tracker-2.0.0
>
>
> On a button or other element that does not leave the page, whose clicks are 
> sent with sendClickEvent, the site's own click handlers ran twice for each 
> click: a toggle switched back, a counter counted double, a menu opened and 
> closed.
> Cause: once the event was sent, the tracker dispatched the click again on the 
> element, and that copy reached all the page's listeners.
> Fix: clicks on elements that do not leave the page are no longer held back 
> nor dispatched again; the event is just sent. Clicks on links and submit 
> buttons are still held back until the event is sent, then dispatched again to 
> the whole page as before, so that routers of single-page applications handle 
> them. Covered by browser tests against each Unomi server.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to