Open akre54 opened 9 years ago
I'm new to NativeView, so I don't have first hand experience (yet), but I would suppose you're correct: delegate() is probably most commonly used by remove(), which will use specific selectors. Additionally, the user-base of NativeView are probably those looking for a fine grained experience - not those looking for the comfort and hand-holding of jquery.
While messing with
NativeView#undelegate
I realized that it's only possible to undelegate using a selector when that selector matches exactly the string passed todelegate
. It doesn't do matching or sub-selections.Let's say you called
view.delegate('click', '*')
and then tried toview.undelegate('click', 'div')
. Orview.delegate('click', 'h1, div')
, or any sub-selector. Since the strings don't match, we wouldn't be able to undelegate for you. Selector strings don't work that way.I'm tempted to say "screw it". Undelegating isn't that common of a use case. We'd have to implement the better part of Sizzle to get this behavior (or call
matches
over aquerySelectorAll
ElementList). Is it worth solving?