#16782 closed enhancement (fixed)
a11yclick: refactor to use event delegation
Reported by: | bill | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | Dijit | Version: | 1.8.3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Dijit/a11yclick creates up to five listeners per node, slowing down widget creation time (and thus page load time). Refactor to use event delegation to avoid this.
There are some caveats to this change:
- If capturing events in the bubbling phase, which is the only way possible on IE6-8, if someone calls stopPropagation() on the keydown or keyup events before they buble to <body>, then no synthetic click event will be generated.
- Same issue with touchend and, depending on implementation, on the click event itself. The difference is that all platforms that support touch events support addEventListener(..., true) to track events in the capturing phase rather than the bubbling phase. But see point (3) regarding that.
- Note that there's an existing bug that calling preventDefault() on a touchstart/touchend/keydown/keyup event will not stop the synthetic click event from firing. Using event delegation actually allows us to handle that case.
Change History (3)
comment:1 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Status: | new → assigned |
comment:2 Changed 8 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Note: See
TracTickets for help on using
tickets.
In [30732]: