Skip to content

Commit c219894

Browse files
committed
chore(VInfiniteScroll): add comment about nested raf
1 parent 9114f12 commit c219894

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/vuetify/src/components/VInfiniteScroll/VInfiniteScroll.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,9 @@ export const VInfiniteScroll = genericComponent<VInfiniteScrollSlots>()({
198198
}
199199
if (props.mode !== 'manual') {
200200
nextTick(() => {
201+
// Browser takes 2 - 3 animation frames to trigger IntersectionObserver after
202+
// VInfiniteScrollIntersect leaves the viewpoint. So far I couldn't come up
203+
// with a better solution than using 3 nested window.requestAnimationFrame. (#17475)
201204
window.requestAnimationFrame(() => {
202205
window.requestAnimationFrame(() => {
203206
window.requestAnimationFrame(() => {
@@ -306,6 +309,7 @@ export const VInfiniteScroll = genericComponent<VInfiniteScrollSlots>()({
306309
)
307310
if (props.mode !== 'manual') {
308311
nextTick(() => {
312+
// See #17475
309313
window.requestAnimationFrame(() => {
310314
window.requestAnimationFrame(() => {
311315
window.requestAnimationFrame(() => {

0 commit comments

Comments
 (0)