Bug Tracker

Opened 7 years ago

Closed 7 years ago

#11693 closed enhancement (worksforme)

Provide an API to only remove non-delegated event handlers

Reported by: gravof Owned by: gravof
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:

Description

If you pass an event type to .off(), all event handers (delegated & non-delegated) of that type are removed.

If you pass an event type and ** has the selector param, all delegated event handlers of that type are removed.

So what about removing only non-delegated event handlers? It seems that jQuery currently doesn't provide an API to do that, but correct me if I was wrong.

Change History (3)

comment:1 Changed 7 years ago by dmethvin

Owner: set to gravof
Status: newpending

It is not there because nobody ever had a use case. What is your use case?

comment:2 Changed 7 years ago by gravof

Status: pendingnew

To be honest, I later found a way to workaround it, so I don't need this feature anymore, but I guess when the API is asymmetrical, somebody will find a use case and ask about it.

But it's ok to me if you want to deprioritize it. :)

comment:3 Changed 7 years ago by dmethvin

Resolution: worksforme
Status: newclosed

Okay, I'll close this. Post a note back with your use case if you get a chance. In most cases it would be better to use an event class name anyway, such as click.myPlugin.

Note: See TracTickets for help on using tickets.