-
Notifications
You must be signed in to change notification settings - Fork 480
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
Cannot read property 'trigger' of null #679
Comments
Hello, I can't reproduce an error while destroying an open tooltip. Could you please set up a jsFiddle reproducing the error that does not involve your library? Thank you. |
I managed to reproduce it in this codepen https://codepen.io/anon/pen/eWgoGp . Try to click the link as soon as you hover over it (fast), don't wait for the tooltip to show up. |
Thanks for spotting that. There was a timeout that should have been cleared upon destruction, it's fixed now, thank you. |
Hey @louisameline the issue still persists, it's harder to reproduce now in the same codepen but it happens with a similar flow, clicking link that has tooltip which transitions to another page and removes it from the dom. |
Ok, I just need to see the issue to fix it, can you please provide a link? |
It's a bit harder to reproduce it without the ember part now, although that doesn't add additional stuff it just wraps your library in a component and normally when transitioning to another page it's removed from the dom it calls |
I run into trouble when trying to install the repo (windows computer). It would be nice if you could host it somewhere for me. |
Here is the deployed version https://altrim.github.io/bug-tooltipster/ |
The alert is tricky because it suspends the execution of the script. What seems to be happening is that we schedule "close in 350ms", then the alert lasts for 1s (or more), then the destroy method is called synchronously, and it sees that 1s has passed and thinks that the close timeout has been executed, but it hasn't because of the alert. I'm not sure how you could have created this bug without using an alert box or a synchronous xhr call! Anyway, please try with my latest modification. I haven't made a release this time, I just pushed the commit. |
Hi, It seems to work. I have to find a way to manage dependencies with a commit ref to publish the updated bug repo but I tried locally and I don't have the bug. I will confirm a little bit later. Many thanks for your work ! |
Great, you're welcome, let me know and I'll release. |
Hi, |
Thanks a lot for the help 👍 |
Nice. I think we can close this issue and this other one altrim/ember-cli-tooltipster#40 once new releases are done. Thanks for your help. I know it was a lot of works. I love Open Source! |
Great, it's released as v4.2.5. Thank you both for the reports, solved two bugs with one stone :) |
Hello,
While trying to debug this issue altrim/ember-cli-tooltipster#40.
I noticed that when the tooltipster is destroyed (in ember we call destroy when the component is removed from the dom) the references to the emitters are also removed https://github.com/iamceege/tooltipster/blob/master/dist/js/tooltipster.bundle.js#L2576
But then right after that somehow
_trigger
is called here https://github.com/iamceege/tooltipster/blob/master/dist/js/tooltipster.bundle.js#L1529and at this point
https://github.com/iamceege/tooltipster/blob/master/dist/js/tooltipster.bundle.js#L2347
this.__$emitterPrivate
isnull
hence the error.The text was updated successfully, but these errors were encountered: