Bug 146033
| Summary: | Click events nested within click event handlers do not trigger the first time | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Henderson <cwhenderson20> |
| Component: | DOM | Assignee: | Chris Dumez <cdumez> |
| Status: | RESOLVED WORKSFORME | ||
| Severity: | Normal | CC: | benjamin, cdumez, dbates, eric.carlson, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | 525.x (Safari 3.2) | ||
| Hardware: | iPhone / iPad | ||
| OS: | iOS 8.2 | ||
Chris Henderson
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/21547470>
Chris Dumez
Tested on iOS 9 beta using:
http://jsfiddle.net/f0hdqww3/1/
I correctly see "link2 clicked" in the console after clicking link1.
Lucas Forschler
Mass move bugs into the DOM component.