stutrek/scrollmonitor

Not working after initial load when using Turbolinks

JamesHRowe opened this issue · 1 comments

Im having issues with scrollMonitor and Turbolinks. On initial load the scrollMonitor watchers work and fire correctly but after visiting another page they cease to work. I initially used the Turbolinks "no-cache" tag to stop caching but it to no avail. I have also used "recalculateLocations" to try and re-initialise the positions but still they will not fire.

The only way it will work is with a full page reload but then Turbolinks features become redundant.

I haven't used it, but it looks like with turbolinks you'll have to recreate your state from scratch. It's swapping out the whole DOM, so you'll have to point scrollmonitor at the new DOM.