Bug Tracker

Modify

Ticket #11693 (closed enhancement: worksforme)

Opened 13 months ago

Last modified 13 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 13 months ago by dmethvin

  • Owner set to gravof
  • Status changed from new to pending

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

comment:2 Changed 13 months ago by gravof

  • Status changed from pending to new

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 13 months ago by dmethvin

  • Status changed from new to closed
  • Resolution set to worksforme

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.

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.