-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
can-component beforeremove
-event does not fire with [email protected]
#178
Comments
Thanks, I'll see if I can recreate. |
I created a glitch: https://glitch.com/edit/#!/sophisticated-turkey?path=server.js:13:0 What I see there seems to work: Using your deps list. What's different? |
@matthewp : in sorry, i am not familiar with |
Ah, I see. Interesting... ok, this gives me something to work with so I'll check it out. |
@matthewp : |
Hm, so probably not a bug in can-zone but rather more likely in done-ssr. Trying to think if we had tests with beforeremove... |
[email protected] added
Node.prototype.removeEventListener
toregister.js
which caused can-component/can-controlbeforeremove
-event to not fire.https://v3.canjs.com/doc/can-component/beforeremove.html
it seems the
beforeremove
-event-handlers are being removed byNode.prototype.removeEventListener()
(incan-simple-dom/lib/simple-dom/event.js
) beforeNode.prototype.dispatchEvent()
can call thebeforeremove
-event-handlers.Node.prototype.removeEventListener()
is removing thebeforeremove
-event-handlers becauseif (handlersByType[index] === handler) {
evaluates to true for [email protected] (vs false for [email protected]).in my donejs@1 sample app, with [email protected] the log-message for the
beforeremove
-event is displayed in the terminal-console, but with [email protected] the log-message is missing. we use thebeforeremove
-event to cleanup timers and element-event-bindings.src/index.stache
...src/mobile/index/index.js
...package.json
...[email protected]
to resolve a memory-leak-issue because of can-view-import-promise.The text was updated successfully, but these errors were encountered: