# Ion-list itemSliding

**URL:** <https://forum.ionicframework.com/t/ion-list-itemsliding/98569>\
**Category:** ionic-v3\
**Created:** [July 18, 2017, 7:40am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569 "2017-07-18T07:40:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashley\_shookhye](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ashley\_shookhye](https://forum.ionicframework.com/u/ashley_shookhye)\
**Post date:** [July 18, 2017, 7:40am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/1 "2017-07-18T07:40:45Z")

</div>

Dear All,

For an ion-list with itemsliding options, if there are two or more, when you slide the first one and once you slide the second one, the first one closes automatically. For me in my app, the others are not closing automatically. All ion-items are left open.  
Can you please advise?

Ashley

---

<div class="post-metadata">

**Author:** ![luukschoen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luukschoen/32/98585_2.png) [@luukschoen](https://forum.ionicframework.com/u/luukschoen)\
**Post date:** [July 18, 2017, 9:17am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/2 "2017-07-18T09:17:29Z")

</div>

Could you provide us with your code regarding the issue? It would be nice to have your ionic info output here as well.

---

<div class="post-metadata">

**Author:** ![ashley\_shookhye](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ashley\_shookhye](https://forum.ionicframework.com/u/ashley_shookhye)\
**Post date:** [July 18, 2017, 9:32am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/3 "2017-07-18T09:32:39Z")

</div>

Hello Sure,

ionic info:  
global packages:

```
@ionic/cli-utils : 1.5.0
Ionic CLI : 3.5.0

```

System:

```
Node : v6.9.2
OS : Windows 8.1
Xcode : not installed
ios-deploy : not installed
ios-sim : not installed
npm : 3.10.9

```

Html code:

```auto
        <ion-list *ngFor="let employee of employees; let i = index" >
          <ion-item-sliding>
            <ion-item class="lst-emp">A
            </ion-item>
            <ion-item-options side="right">

              <button ion-button class="color-edit" icon-left (click)="show(employee)">
                      <ion-icon class="white" name="create" ></ion-icon>
                      <div class="white">
                        Edit
                      </div>
                    </button>

            </ion-item-options>
          </ion-item-sliding>

```

Thanks,  
Ashley

---

<div class="post-metadata">

**Author:** ![elvis\_gn](https://avatars.discourse-cdn.com/v4/letter/e/5f8ce5/32.png) [@elvis\_gn](https://forum.ionicframework.com/u/elvis_gn)\
**Post date:** [July 18, 2017, 9:41am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/4 "2017-07-18T09:41:16Z")

</div>

I think it’s because you are looping on the ion-list and hence for each ion-item there is a new sliding section created.

Put the ngFor on the ion-item.

---

<div class="post-metadata">

**Author:** ![luukschoen](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/luukschoen/32/98585_2.png) [@luukschoen](https://forum.ionicframework.com/u/luukschoen)\
**Post date:** [July 18, 2017, 9:42am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/5 "2017-07-18T09:42:27Z")

</div>

@elvis_gn gives you the wright answer. Don’t loop over the ion-list, loop over the ion-item-sliding. Otherwise you’ll get a new instance of a list every time again. So the items won’t close, because they’re are actually in separate lists.

---

<div class="post-metadata">

**Author:** ![ashley\_shookhye](https://avatars.discourse-cdn.com/v4/letter/a/ea5d25/32.png) [@ashley\_shookhye](https://forum.ionicframework.com/u/ashley_shookhye)\
**Post date:** [July 18, 2017, 9:59am UTC](https://forum.ionicframework.com/t/ion-list-itemsliding/98569/6 "2017-07-18T09:59:56Z")

</div>

Thank you so much. dont know how i miss that,
