Bug Tracker

Opened 7 years ago

Closed 5 years ago

Last modified 4 years ago

#4886 closed enhancement (patchwelcome)

Allow selective .die()

Reported by: ligreman Owned by: brandon
Priority: low Milestone:
Component: event Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

If you bind multiple events to a child element (e.g. "p span") then use the die even to remove one of them it removes all events bound to that, instead of only one.

Example attached.

Attachments (1)

prueba.html (991 bytes) - added by ligreman 7 years ago.
Example showing the bug

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by ligreman

Example showing the bug

comment:1 Changed 5 years ago by dmethvin

  • Milestone 1.4 deleted
  • Status changed from new to open

comment:2 Changed 5 years ago by dmethvin

  • Keywords needsdocs added; die event removed
  • Priority changed from major to low
  • Summary changed from Bug in event DIE. to Allow selective .die()
  • Type changed from bug to enhancement

I'm recasting this as an enhancement, we need to document that (at least up to 1.4.4), the selector in .die() must exactly match the one in .live().

See the discussion here, with a proposed patch:

http://forum.jquery.com/topic/building-out-live-and-die

Bugs #5662 and #7520 may be related.

comment:3 Changed 5 years ago by john

  • Resolution set to patchwelcome
  • Status changed from open to closed

I'm fairly certain we have this documented now, but leaving the needsdocs just in case.

But yeah, I'm OK with the current functionality. If someone comes up with a smaller patch (than the one that was shown in the forum thread) and with a test case, please feel free to re-open!

comment:4 Changed 5 years ago by dmethvin

  • Keywords needsdocs removed

comment:5 Changed 4 years ago by anonymous

Test case example: http://jsfiddle.net/pPuG5/

Note: See TracTickets for help on using tickets.