Bug 107895 - Simulated click events generated after a touchend event should be triggered on the touch's target element
Summary: Simulated click events generated after a touchend event should be triggered o...
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-24 19:09 PST by Ian White
Modified: 2019-02-06 09:18 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ian White 2013-01-24 19:09:09 PST
Steps to Reproduce:
1. Trigger a touchstart, touchmove, touchend event on a given element on an iOS device
2. One of the touch handlers for that element changes the location of the touched target element in the viewport and moves a different element that responds to click events into the same location as the initial target element.
3. Observe that the simulated click event generated after the touch events is triggered on the new element, not the original target element of the touch events.

Expected Results:
The simulated click event should be triggered on the initial target elements of the touch event, not whichever element happens to be in the same location as the touch event 300ms later.
Comment 1 Matt Mueller 2013-07-02 18:09:28 PDT
This bug is a big issue for me too on mobile safari. Here's another way to reproduce:

1) bind touchend event to element on top of another element
2) bind click event to element underneath
2) on-touchend hide top element
3) on-click log e.target

You'll notice that ontouchend gives you top element, while onclick will give you a target of the element underneath.

Heres a demo: http://jsbin.com/ukezaq/2

You need to use the simulator / mobile device / tablet to see the issue.
Comment 2 Ognian 2013-07-18 02:27:29 PDT
I think I have the same problem. Newest Mobile Safari Beta.

1. touchstart on a "dojo dijit/form/Button" (actually some span's with the touch handler bound to one of them) inside div1
2. this leads to creation of div2 and another "button" occupying the space of div1
3. touching on the newly created button leads to a touch start with event.target set to div1 instead of the actual span inside div2

The problem is always reproduce able with my app but a very reduced test case didn't reproduce it
Comment 3 Lucas Forschler 2019-02-06 09:18:26 PST
Mass move bugs into the DOM component.