Ion-item-sliding not working on phone (ionic v4)

Hello all,

is anybody else finding this issue? Using version 4.0.0-beta.7, once deployed in Android or iOS, the sliding works fine initially, but after a while it is not possible to use swiping anymore on the items, unless the app is killed and open again. I still did not find a pattern on when or why it stops working. Here is sample code.

Thanks!

    <ion-reorder-group disabled="false">
      <ion-item-sliding *ngFor="let item of items">
        <ion-item>
          <ion-reorder slot="start"></ion-reorder>
          <ion-input type="text" 
                     name="{{item.id}}" 
                     [(ngModel)]="item.name" 
                     (blur)="saveChanges()"></ion-input>
          <span class="spacer"></span>
        </ion-item>
        
        <ion-item-options side="end">
          <ion-item-option color="primary" (click)="confirmItemDeletion(item)">
            <ion-icon name="trash"></ion-icon>  
          </ion-item-option>
        </ion-item-options>
      </ion-item-sliding>
      
    </ion-reorder-group>
2 Likes

I guess, according your function’s name, it doesn’t work not after a while but after you delete an item and remove it from the list

Therefore, here you go for the solution → [Ionic V4.0.0-beta.7] [ion-item-sliding] Sliding not working after empty an element in array · Issue #15486 · ionic-team/ionic-framework · GitHub

The trick is to call closeSlidingItems() after the deletion

1 Like

Thanks!

You are correct, it was because of the closeSlidingItems().

The strange thing is that I was doing it, but, might be because of the version update to beta7 it was not working anymore as I was using 'nativeElement.closeSlidingItems(). I changed it to use theViewChilddirectly with theListand not using theElementRef`.

Thanks

1 Like