Open griffinallen opened 1 month ago
It has a frame debounce, you will have to use requestAnimationFrame instead of nextTick: https://github.com/vuetifyjs/vuetify/blob/7d3557a75497c508e2d7f855b5db54fc52d7ec9e/packages/vuetify/src/composables/virtual.ts#L184-L187
scrollToIndex should be async and wait for render before returning.
setTimeout(50) might work sometimes but will break if you get a frame that takes over 50ms.
It has a frame debounce, you will have to use requestAnimationFrame instead of nextTick:
scrollToIndex should be async and wait for render before returning.
setTimeout(50) might work sometimes but will break if you get a frame that takes over 50ms.
I have tried your instructions and it solves one part of the issue. When you are at the bottom of the list and add another item, it now displays the next item. However, if you are not add the bottom of the list and add another item, it will still scroll to the second to last item in the list.
Maybe I have misunderstood your instructions. Can you provide a working example?
This look like my closed issue
This look like my closed issue
Did your solution work for you? I still seem to get the same error with your solution.
If you are already on the last element and add another, it correctly scrolls to the newly added element. However, if you aren't at the bottom of the list, it scrolls to the second to last element.
also affecting me
what i had going on was after scrolling to bottom, a moment later the scrollHeight would increase by an item's height. The list size wasn't changing. Ended up doing setTimeout 250ms and doing requestAnimationFrame scrollToIndex again after the initial scroll.
what i had going on was after scrolling to bottom, a moment later the scrollHeight would increase by an item's height. The list size wasn't changing. Ended up doing setTimeout 250ms and doing requestAnimationFrame scrollToIndex again after the initial scroll.
This works for me too. Still hoping the correct fix gets implemented soon, but this works for the time being.
Environment
Vuetify Version: 3.7.1 Vue Version: 3.5.6 Browsers: Chrome 128.0.0.0 OS: Windows 10
Steps to reproduce
Expected Behavior
The list should be scrolled so that the newest added item is now visible.
Actual Behavior
The list scrolls such that the second to last item is visible, but the newly added item is still not visible.
Reproduction Link
https://play.vuetifyjs.com/#...