tangbc / vue-virtual-scroll-list

⚡️A vue component support big amount data list with high render performance and efficient.
https://tangbc.github.io/vue-virtual-scroll-list
MIT License
4.41k stars 592 forks source link

when update nuxt to 2.4.3, and set the offset value is not jump to a right position in list #85

Closed yoruponder closed 5 years ago

yoruponder commented 5 years ago

nuxt1.4.2

wx20190212-151054 2x

nuxt 2.4.3

wx20190212-151028 2x
yoruponder commented 5 years ago

@tangbc hi~ Is there any solution to fix this bug? buremba says that vue 2.6.6 breaks this library, and other library <Akryum/vue-virtual-scroller> had fixed now. 😊😊😊 這個問題其實是動態修改offset后的定位問題哈,Nuxt 1.4.5的時候點B標籤設置offset能準確定位到B字母開頭的位置,但是升級Nuxt2.4.3后同樣的offset值定位卻不准,如需要我可以提供下bug的重現哈~麻煩作者啦

tangbc commented 5 years ago

@yoruponder The same issue in <Akryum/vue-virtual-scroller> just sloved by add key-field?

It's better if you can give me a reproduced repo.

yoruponder commented 5 years ago

@tangbc Hi, I create two repositories to reproduce the question. Normal in Nuxt 1.4.5 https://github.com/yoruponder/virtual-scroll-nobug-1.4.5 Not perfect in Nuxt 2.4.3 https://github.com/yoruponder/virtual-scroll-bug-2.4.3

tangbc commented 5 years ago

@yoruponder I was able to reproduce the bug on your repo, but I couldn't find the exact reason for it for a long time.

I try to log and found that the offset number you pass to virtual-list and which we get it from real DOM is same, so, this bug maybe not come from virtual-list.

The way virtual-list set offset just simply use JavaScript API el.scrollTop = offset, it maybe some strange behaviors in nuxt or vue latest when set scroll or ui render.

Continue watch for this ....

image

yoruponder commented 5 years ago

@tangbc maybe this bug like buremba say, that coms from new vue version when Vue update to 2.6.6, maybe some new feature impacts virtual-list. is there any solution to fix it?

tangbc commented 5 years ago

Not yet.