Skip to content
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

Elements disappearing upon re-write in dev mode [HMR] #10

Open
acidjazz opened this issue Jun 28, 2019 · 8 comments
Open

Elements disappearing upon re-write in dev mode [HMR] #10

acidjazz opened this issue Jun 28, 2019 · 8 comments

Comments

@acidjazz
Copy link

acidjazz commented Jun 28, 2019

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.

@weotch
Copy link
Member

weotch commented Jun 28, 2019

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.

@acidjazz
Copy link
Author

@weotch i am pretty sure i am . great to hear, and you don't ever encounter this?

@weotch
Copy link
Member

weotch commented Jun 28, 2019

Hermm, I don't remember seeing it in 2.x, but I know what you mean from 1.x...

@acidjazz
Copy link
Author

@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.

@acidjazz
Copy link
Author

@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)

goesaway

@acidjazz
Copy link
Author

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

@acidjazz
Copy link
Author

versions installed:

image

@acidjazz
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants