canjs / can-util

Essential utilities used by lots of CanJS's projects.
https://canjs.com/doc/can-util.html
MIT License
10 stars 8 forks source link

delegated CanJS "custom" events aren't triggered #390

Closed nlundquist closed 7 years ago

nlundquist commented 7 years ago

Custom CanJS events like the 'enter' event implemented by can-event-dom-enter don't work when used via event delegation, see:

http://jsbin.com/tumalorinu/edit?html,console,output

The enter events keyup handler runs, identifies that it's an enter keypress and runs the delegated handler. The delegated handler then looks to see if there's a delegated event with the type of the current event (dom/events/delegate/delegate.js line 50).

That check fails since it tries to lookup the name of the DOM event (keyup in this case) when the map has an entry keyed by the name of the CanJS custom event (enter).