-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
VirtualScroller: scrollInView method does not scroll to right item, when item is dynamically added #6986
Comments
Due to PrimeVue team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. ✨ Thank you for your contribution! ✨ |
After some code analysis, I believe this is due to a change in Vue's If items are added to the A potential fix to the items watcher could look as follows (without respecting, if the array changed at all).
Hope this helps and can be fixed in an upcoming release. Thank you. |
These changes are not enough. if you scroll to the bottom of the list you risk calling onScrollPositionChange many times. Reproducer: https://rdjblce9.stackblitz.io |
Describe the bug
VirtualScroller: scrollInView method does not scroll to right item, when item is dynamically added
Same issue applies to DataTable when using VirtualScroller feature.
Reproducer
https://stackblitz.com/edit/qe6t4tk3?file=src%2FApp.vue
PrimeVue version
4.2.5
Vue version
3.4.29
Language
TypeScript
Build / Runtime
Vite
Browser(s)
Chrome
Steps to reproduce the behavior
Place a VirtualScroller component on the page.
Add an item to the items array.
Use the ScrollInView method, to scroll to the newly created item on the very bottom.
Observe, that it is not fully scrolling to the bottom.
Expected behavior
ScrollInView method shall display the newly created item on the very bottom of the VirtualScroller.
The text was updated successfully, but these errors were encountered: