-
Notifications
You must be signed in to change notification settings - Fork 824
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
Uncaught TypeError: Cannot read property 'destroy' of undefined #367
Comments
Hmm... I would not use the jquery plugin if you can avoid it - it's not been updated in a long time and i will eventually deprecate/delete it completely. Try the vanilla JS version, and see if that fixes. |
I used
I used vanilla js and have same problem. Look, I use simple code from your example, if and outpute in console object.
If I dont use setTimeout, I have error:
|
Up! |
Hey @WickyNilliams, i have the same issue, the reason is scrollTracker is initialized inside setTimeout, and destroy can be called before that. It seems you had this same issue before and you fixed it, but now it is reintroduced again. |
I am also experiencing this issue and agree with the assessment from @skosito . Here's a cheap workaround that I use just before calling destroy():
|
faced the same issue. I wanted to disable Headroom on some specific pages and getting error while tried to use the destroy. Can you suggest any solution to disable it by checking some conditions? |
Facing the same issue while integrating the vanilla JS version in a React app -- race condition triggered while running the React Testing Library / Jest tests. |
For me it worked if I used the function on the child ref, scrollTracker, like this in React:
|
Good day. I use your library for the Elementor and I need to change offtop by controls. So I use headroom( 'destroy' ), and after I initialization with new options. If I quickly change the value I have error:
https://monosnap.com/file/frAhbSGl7HV8adOGDYaiN77TOCbADi
The text was updated successfully, but these errors were encountered: