Bug 146033 - Click events nested within click event handlers do not trigger the first time
Summary: Click events nested within click event handlers do not trigger the first time
Status: RESOLVED WORKSFORME
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 525.x (Safari 3.2)
Hardware: iPhone / iPad iOS 8.2
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-06-16 16:00 PDT by Chris Henderson
Modified: 2019-02-06 09:18 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Henderson 2015-06-16 16:00:31 PDT
In mobile Safari, click events within click handlers do not trigger on the first click.

Example code:
-------------
document.querySelector('.link-one').addEventListener('click', function () {
    document.querySelector('.link-two').click();
});

In Chrome (mobile and desktop) as well as in desktop Safari (8.0.6), clicking a link with a class of "link-one" will then trigger the programmatic click of a link with class "link-two". Mobile Safari, however, does not trigger the click until the ".link-one" element is clicked a second time.
Comment 1 Radar WebKit Bug Importer 2015-06-25 10:11:18 PDT
<rdar://problem/21547470>
Comment 2 Chris Dumez 2015-08-06 17:00:31 PDT
Tested on iOS 9 beta using:
http://jsfiddle.net/f0hdqww3/1/

I correctly see "link2 clicked" in the console after clicking link1.
Comment 3 Lucas Forschler 2019-02-06 09:18:47 PST
Mass move bugs into the DOM component.