bug: Virtual list append item update will miss items render
- Framework7 version: 4.4.6
- Platform and Target: Chrome browser
- Live Link or JSFiddle: https://jsfiddle.net/mohshraim/1xs382bu/
Describe the bug
when add items to VL then scroll top, result that top items will disappear.
To Reproduce
Steps to reproduce the behavior: please check jsFiddle: https://jsfiddle.net/mohshraim/1xs382bu/ 1- open about page 2- scroll to buttom until reach item 49 which will load with delay 3-scroll to top again,, top items will disappear.. + 4- while you are on top of page click on nav buttton updateVL 5- this will show top items again... but when you scroll down bottom items will disappear. and so on
THANKS
У меня была внешне похожая ситуация, причина - ошибка в моем коде. Рекомендую вам сравнить свой код с Kitchen, там все работает.
@shastox
Kitchen doen't contain any example with virtualList.appendItems which is the reason of bug in indirect way that prevent virtualList.render () from working as expected.
Я за вас нашел ошибку в вашем коде:
if (reachEnd) {
app.infiniteScroll.destroy('#feed-list-pageContent'); //ERROR
$$('#feed-list-infinite-scroll-preloader').remove();
}
Вы просто уничтожаете page-content когда доходите до низа.
@shastox
This related
but i didnt destroy the page content,, i destroy infiniteScroll component
to stop fire on('infinite', function () { ....
while i was tracing the source code on F7 i found that destroy infiniteScroll component will stop
VirtualList.prototype.handleScroll() from firing at F7 core... line 16827 ...
so in another words destroy infinitScroll will stop handelScroll on virtualList..
so bug is special case
and my work around to stop the destroy on infinitScroll and keep ignoring on('infinite', function () { .... by adding any public variable..
will keep it open and let @nolimits4web check if that should be fixed or ignored
Thanks @shastox for your help