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
It hasn't assigns posElement by getElementsPosition()
You may addposElement = _this.getElementsPosition(); to line 268
or trigger window resize by your self.
just faced the same Error ( also using this lib in my React component )
As @jamestsang said, triggering resize manually fixes it.
Just do it immediately after you call mm.init() with this: window.dispatchEvent(new Event('resize'))
I think it's because it tries to get the element position on DOMContentLoaded and your script runs after that event fires, so posElement remains undefined
// Calculate position of element when page load
document.addEventListener('DOMContentLoaded', () => {
posElement = this.getElementsPosition();
});
Getting this error:
my code: (React)
The text was updated successfully, but these errors were encountered: