mercs600 / vue2-perfect-scrollbar

Vue.js wrapper for perfect scrollbar
https://mercs600.github.io/vue2-perfect-scrollbar/
MIT License
275 stars 43 forks source link

ps-y-reach-end event triggers before going to another page #46

Closed zaharr2 closed 4 years ago

zaharr2 commented 4 years ago

I use this event for infinity scroll. But When you go to another page, the event triggers one more time. I can’t figure out how to avoid this.

mercs600 commented 4 years ago

I can imagine only that is caused because when you load a new page, content in your scrollbar container is loading asynchronously and before content will appear there this event is called. Just check this hypothesis with empty scrollbar container and listen on this event.

Are you able to reproduce this issue to me on code sandbox ?

zaharr2 commented 4 years ago

Unfortunately, I do not know how to use the codebox. I'll try to figure it out later. I’ll describe the problem a little more. This event is called from a component that is not on the new page. It feels like it's being called before the page is deleted. For example, I’m going from the purchase page to my account page. The perfect scroll component is on the purchase page and is not on the account page. During the transition from the purchase page to the page of my account, an event ps-y-reach-end is triggered.

zaharr2 commented 4 years ago

It turns out that the event is called from the previous page immediately before switching to a new one.

zaharr2 commented 4 years ago

I think I solved the problem. I'm sorry. This was not associated with vue2-perfect-scrollbar. Hold the star =)