DOM event .off('event') does not unbind
See original GitHub issueThis is a (multiple allowed):
- bug
- Framework7 Version: 1.4.2
- Platform and Target: All platforms
What you did
Tried to unbind an event attached to an element.
$$(this.form).off('submit').on('submit', function (e) {
//...
});
Expected Behavior
Should unbind event and re-attach it.
Actual Behavior
Does not unbind event, as a result the event is bound multiple times (this code is called each time a particular page is inited).
Issue Analytics
- State:
- Created 7 years ago
- Comments:15
Top Results From Across the Web
DOM event .off('event') does not unbind · Issue #1110 - GitHub
Does not unbind event, as a result the event is bound multiple times (this code is called each time a particular page is...
Read more >jQuery off() is not unbinding events when using bind
The problem is that this._click.bind() creates a new function every time it's called. In order to detach a specific event handler, ...
Read more >.unbind() | jQuery API Documentation
A string containing one or more DOM event types, such as "click" or "submit," or custom event names. ... The function that is...
Read more >Binding and unbinding of event handlers - plainJS
It's not required to unbind event handlers when removing DOM elements. JavaScript's garbage collection will take care of it and free up the...
Read more >jQuery .unbind() Event Method
In this jQuery tutorial reference we learn how to use the .unbind() method to unattach a previously bound event handler(s) from the specified...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
define
What’s happening? Is the handler being added twice? not at all? What is ‘aa’?
because to javascript it’s not the same function because the function would be redeclared in each call of page:init