Opened 9 years ago

Closed 9 years ago

Last modified 7 years ago

#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:


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:

  1. 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.
  2. 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.
  3. 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 9 years ago by bill

Milestone: tbd1.9
Status: newassigned

comment:2 Changed 9 years ago by bill

Resolution: fixed
Status: assignedclosed

In [30732]:

for performance, use event delegation in a11yclick, fixes #16782 !strict

comment:3 Changed 7 years ago by Bill Keese <[email protected]…>

In c535128334b5a130b78c79b87d2b236ab0490d9b/dijit:

Error: Processor CommitTicketReference failed
Unsupported version control system "git": Can't find an appropriate component, maybe the corresponding plugin was not enabled? 
Note: See TracTickets for help on using tickets.