vue-in-viewport-directive
vue-in-viewport-directive copied to clipboard
Elements disappearing upon re-write in dev mode [HMR]
This is in no way a major priority since this is not an issue in a production environment.
I use nuxtjs and when in dev mode it takes advantage of webpack and HMR. A good amount of times when I save files and look to see the changes, elements that have v-in-viewport bound to them will disappear. I think this might be the components re-firing and possibly not detecting that they are still w/in the viewport. A refresh fixes this but it would be nice to not have to keep refreshing.
Are you using 2.x version of this package? It uses IntersectionObserver and should be more reliable in this event than the ScrollMonitor based method of 1.x.
FWIW, we also use Nuxt and Dev mode almost exclusively when doing Vue.js.
@weotch i am pretty sure i am . great to hear, and you don't ever encounter this?
Hermm, I don't remember seeing it in 2.x, but I know what you mean from 1.x...
@weotch to be specific, say i have dev mode on and i have an element with (v-in-viewport) on it, and i then add/remove a class and save that file, the element will then disappear until i refresh.
@weotch for example, here i have a .vue file open w/ an element, i change my class from vp-r to vp-l , and as soon as i save the file you can see in the browser behind it disappears (until i refresh)

@weotch another example to show it doesn't matter which class i change

versions installed:

one last note, scrolling away/back also brings it back