Navigation Menu

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

Potential update issues (updated hook, $nextTick) #34

Closed
WofWca opened this issue Feb 28, 2020 · 8 comments · Fixed by #37
Closed

Potential update issues (updated hook, $nextTick) #34

WofWca opened this issue Feb 28, 2020 · 8 comments · Fixed by #37
Labels
enhancement New feature or request

Comments

@WofWca
Copy link

WofWca commented Feb 28, 2020

Shouldn't it call ps.update() on the next tick after the updated hook has been called?
See what Vue docs say:
https://vuejs.org/v2/api/#updated, (page source code)

@mercs600
Copy link
Owner

Ok, right it may cause some issues, did you see some troubles with that ?

@WofWca
Copy link
Author

WofWca commented Feb 28, 2020

I personally did not happen to.

@mercs600
Copy link
Owner

mercs600 commented Feb 28, 2020

Ok, we can setup it on nextTick ofc

@mercs600 mercs600 added the enhancement New feature or request label Feb 28, 2020
@Dagdelo
Copy link

Dagdelo commented Mar 4, 2020

I have this issue, I'm trying to implement an infinite scroll when the event 'ps-y-reach-start' more elements are provided, but the scroll bar jumps to the top... The position of the scrollbar should be preserved, but it's not :(

@mercs600
Copy link
Owner

mercs600 commented Mar 4, 2020

@Dagdelo Are you able to reproduce it on code sandbox ?

@Dagdelo
Copy link

Dagdelo commented Mar 4, 2020

Yeah. Just give-me some time.

@Dagdelo
Copy link

Dagdelo commented Mar 4, 2020

https://codesandbox.io/s/vue-perfect-scrollbar-component-local-registration-gdrg4

If we add items on top of the list, the undesirable behavior happens... But when we add on the bottom it acts as expected.

Note: if I don't call update on the PS instance, the scrollbar just updates when the user scrolls; if we add an @ps-y-reach-start they enter in a disgusting loop since when adding on the top the scrolls go to the top instead of preserves his position. (Solved with @ps-y-up and ps.reach === 'start')

Note2: when it comes to addition to the end of the list they work perfectly.

@mercs600
Copy link
Owner

@Dagdelo I edited your codesandbox project and just added local perfect scrollbar component with update method on $nextTick cycle. Just check it is helpful for you ? . https://codesandbox.io/s/vue-perfect-scrollbar-component-local-registration-rhvle?fontsize=14&hidenavigation=1&theme=dark

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

Successfully merging a pull request may close this issue.

3 participants