jashkenas / backbone

Give your JS App some Backbone with Models, Views, Collections, and Events
http://backbonejs.org
MIT License
28.09k stars 5.39k forks source link

[Feature Request] Using non-delegatable events in the events hash #4200

Closed shishirkulkarni closed 1 year ago

shishirkulkarni commented 6 years ago

It would be nice if we could specify bindings for non-delegatable events like scroll in the events hash. That way it would remove the burden from the developer to bind and unbind such events manually. To differentiate such events from delegated ones, we could prefix the event name with some character like *: Example:

events: {
        "*scroll .my-list": "listScrolled"
}
jgonggrijp commented 1 year ago

While I appreciate the use case, I agree with https://github.com/jashkenas/backbone/pull/4199#issuecomment-480583243 that it would be better served by a subview. I feel that introducing new syntax for this is scope creep.