You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I navigate away from a component that's resize aware and then resize the window, I get an error:
Uncaught TypeError: Cannot read property '0' of undefined
on this line:
return this.$()[0].getClientRects()[0];
I assume because the events are not cleaned up? Should the mixin also include a willDestroyElement hook that removes the event listeners?
Also, it's good to add a reminder to the docs to call this._super on didInsertElement if it's overriden when using the mixin. Took me a while to realize why it wasn't working.
The text was updated successfully, but these errors were encountered:
FYI for anyone coming across this error in the future, ensure that if your component calls willDestroyElement it also calls this._super. Like the initial comment, took me a little while to realize that was why the events were not being de-registered and that then caused the initial error.
I would probably have run into this later today! Glad I saw this. That sounds like a good thing to add to the readme. (I know - maybe you should know* this already) --- but it would be a nice reminder.
When I navigate away from a component that's resize aware and then resize the window, I get an error:
on this line:
I assume because the events are not cleaned up? Should the mixin also include a
willDestroyElement
hook that removes the event listeners?Also, it's good to add a reminder to the docs to call
this._super
ondidInsertElement
if it's overriden when using the mixin. Took me a while to realize why it wasn't working.The text was updated successfully, but these errors were encountered: