How can I remove the border from the last ion-item in an ion-list

Issue

I have a standard ion-list of ion-items which is dynamically populated.

<ion-list>
   <ion-item></ion-item>
   <ion-item></ion-item>
   <ion-item></ion-item>
</ion-list>

I would like to make it so that the standard border doesn’t show up on the last ion-item in the list.

I’ve tried the following but it is just removing the border from every item.

 ion-list ion-item:last-child{
    --inner-border-width:0;
  }

Solution

Hello I had misunderstood your question and I thought you wanted to remove the bottom line.

<ng-container *ngFor="let item of itemList; let last = last;">
    <ion-item [lines]="last ? 'none' : 'full'">{{item.value}}</ion-item>
  </ng-container>

Solutions

Best regards and I hope this can help you

Answered By – Jonathan Duarte

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published