Bug Tracker

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#12934 closed bug (notabug)

literal object event listener causes "too much recursion" error

Reported by: [email protected] Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.3
Keywords: Cc:
Blocked by: Blocking:

Description

I found when I use a custom event trigger & listener, the listener of the object may fall into too much recursion loop and overflow the stack

Demo: http://codepen.io/vincicat/pen/bIjzJ

I am able to stop it by calling e.preventDefault() & e.stopProgation() in the event listener for the object event (line 12)

Fixed Demo: http://codepen.io/vincicat/full/fdLqr

it seems like a bug as the callback loop itself. Any idea?

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Resolution: notabug
Status: newclosed

You're triggering an event name with the same name as your method. Please read the docs for .trigger() and use .triggerHandler() if you don't want that.

comment:2 in reply to:  1 Changed 10 years ago by [email protected]

Replying to dmethvin:

You're triggering an event name with the same name as your method. Please read the docs for .trigger() and use .triggerHandler() if you don't want that.

Thx. I finally find that important note in the bottom of the doc - if the box is shown like $.load() that will make people notice.

Note: See TracTickets for help on using tickets.