#12934 closed bug (notabug)
literal object event listener causes "too much recursion" error
Reported by: | 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 follow-up: 2 Changed 10 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
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.
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.