Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 49210

VirtualScroll broken with pipe filter

$
0
0

@marcwadai wrote:

This issue is the same as described herehttps://github.com/ionic-team/ionic/issues/12307

Since migration to ionic 3.5.2 the pipe on an virtual scroll is not working anymore. (it was working before)
The items in the virtual scroll are not updated but the filtered function works well and return the good values.

My filter looks like this :

@Pipe({
  name: 'RentalPipe'
})
export class RentalFilter {
  transform(value, args?) {
    if (value.length > 0){
      let rental = (args) ? args : {id :"all"};
      console.log("rental filtered", rental);
      if (rental.id == "all"){
        return value;
      }else{
        let filtered =  value.filter(one => {
          return one.rental.id == rental.id;
        });
        console.log("filtered", filtered);
        return (filtered) ? filtered : [];
      }
    }else{
      return [];
    }
  }

}

and in the component :

<ion-list [virtualScroll]="bookingList | RentalPipe:selectedDisplay" [approxItemHeight]="'150px'">
      items ...
</ion-list

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 49210

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>