Skip to main content

Bug Tracker

Side navigation

#14241 closed bug (notabug)

Opened August 09, 2013 11:27AM UTC

Closed August 09, 2013 11:54AM UTC

Last modified August 09, 2013 12:21PM UTC

jQuery.one runs multiple times when assigned with multiple event types

Reported by: nat@nath.is Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:
Description

When you use jQuery.one with multiple event types, the handler can end up being triggered multiple times. I'm not sure if that's expected behaviour or not, but I thought the idea for jQuery.one was the handler could only be called once?

Anyway, you can find a test case http://jsfiddle.net/nathggns/UPAW8/3/

If the bug were to be fixed, I think the counter should never go above 1.

Attachments (0)
Change History (5)

Changed August 09, 2013 11:54AM UTC by scottgonzalez comment:1

resolution: → notabug
status: newclosed

You're saying bind two event handlers: A click and mouseenter, each of which can only run once. I've filed a docs issue to clarify: https://github.com/jquery/api.jquery.com/issues/352

Changed August 09, 2013 12:01PM UTC by anonymous comment:2

Yes, I thought it could be a docs issue. Maybe it might be worth creating a function that will only call the handler once regardless of how many event types you assign it to.

Changed August 09, 2013 12:13PM UTC by scottgonzalez comment:3

http://api.jquery.com/category/deferred-object/

Please ask for help on the forums, IRC, or Stack Overflow.

Changed August 09, 2013 12:19PM UTC by dmethvin comment:4

#14240 is a duplicate of this ticket.

Changed August 09, 2013 12:21PM UTC by dmethvin comment:5

#14239 is a duplicate of this ticket.