Skip to content

Undelegating differs from jQuery #19

Description

@akre54

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 to delegate. It doesn't do matching or sub-selections.

Let's say you called view.delegate('click', '*') and then tried to view.undelegate('click', 'div'). Or view.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 a querySelectorAll ElementList). Is it worth solving?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions