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
[4.0.0-beta.13] ion-virtual-scroll: does not handle css class correctly #16050
Describe the Bug
If you use <ion-virtual-scroll> and assign a css class to an item then the logic to append additional classes does not include a delimiter.
The following code is used in the ionic component:
// From: virtual-scroll.tsxconstVirtualProxy: FunctionalComponent<{dom: VirtualNode[]}>=({ dom },children,utils)=>{returnutils.map(children,(child,i)=>{constnode=dom[i];constvattrs=child.vattrs||{};letclasses=vattrs.class||'';// *** ADDS CLASS WITHOUT DELIMITER ***classes+='virtual-item ';if(!node.visible){classes+='virtual-loading';}return{
...child,vattrs: {
...vattrs,class: classes,style: {
...vattrs.style,transform: `translate3d(0,${node.top}px,0)`}}};});};
If an item is rendered with a class then the class names are incorrect.
For example <div class="my-class"> renders as <div class="my-classvirtual-item">. It should be <div class="my-class virtual-item">
A fix would be the following changes:
classes+=' virtual-item';// *** SPACE ADDED BEFORE, REMOVED AFTER ***if(!node.visible){classes+=' virtual-loading';// *** SPACE ADDED BEFORE ***}
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
paulstelzer commentedon Dec 7, 2018
Thanks for your issue! Could you please check if this is still an issue in
beta.17? That would be very nice :)fix(angular): virtual-scroll
fix(angular): virtual-scroll (ionic-team#16729)
ionitron-bot commentedon Jan 12, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.