You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[virtualizer] Elements are not updated after size decrease in large lists (>100 000 elements) #7186
Elements don't get updated after scrolling to an extremely distant item (with index > 100 000) and then reducing the virtualizer's size to a value that is still beyond 100 000. The size change seems to come into effect only once you scroll back and forth past the index 100 000, which is the highest index supported by Polymer iron list.
Expected outcome
Elements should be updated on size changes.
Minimal reproducible example
<scripttype="module">import{Virtualizer}from'@vaadin/component-base/src/virtualizer.js';constscrollTarget=document.querySelector('#scroll-target');constscrollContainer=document.querySelector('#scroll-container');constvirtualizer=newVirtualizer({createElements: (count)=>[...Array(count)].map(()=>document.createElement('div')),updateElement: (el,index)=>(el.textContent=`Item ${index}`),
scrollTarget,
scrollContainer,reorderElements: true,});virtualizer.size=1000000;constscrollTo900000=document.querySelector('.scroll-to-900000');scrollTo900000.addEventListener('click',()=>{virtualizer.scrollToIndex(900000);});constreduceSizeTo900000=document.querySelector('.reduce-size-to-900000');reduceSizeTo900000.addEventListener('click',()=>{virtualizer.size=900000;});</script><divstyle="height: 300px; position: relative" id="scroll-target"><divid="scroll-container"></div></div><buttonclass="scroll-to-900000">Scroll to index 900000</button><buttonclass="reduce-size-to-900000">Reduce size to 900000</button>
Steps to reproduce
Click on "Scroll to index 900000"
Click on "Reduce size to 900000"
See that nothing happens
Environment
Vaadin version(s): 24.4 and possibly earlier
OS: Mac OS
changed the title [-][virtualizer] Elements are not updated after size decrease in large lists (>500 000 elements)[/-][+][virtualizer] Elements are not updated after size decrease in large lists (>100 000 elements)[/+]on Mar 8, 2024
Activity
[-][virtualizer] Elements are not updated after size decrease in large lists (>500 000 elements)[/-][+][virtualizer] Elements are not updated after size decrease in large lists (>100 000 elements)[/+]vursen commentedon Mar 11, 2024
This is a regression introduced by #5650.
vursen commentedon Mar 13, 2024
The issue is also reproducible when increasing the size.