Toggle in ion-list trigers click

Hello guys,

I have a ion-list that should look like the apple clock app on iOS. Basically it’s a list with not clickable items and and a toggle (to activate or deactivate an item). If I click “delete” a delete button should occur and the item becomes clickable (for editing). It worked fine but since I updated from RC1 to 1.0.0 and 1.0.1 the toggle triggers a click.

So if I tap the toggle I’m switching the page, I don’t know why.

I hope that my description was helpful, codepen: http://codepen.io/anon/pen/jPZqJM

Hi,

The problem is that when you create <ion-item> and add href to it, it wraps the content of the <ion-item> into link (<a> element). Just open you codepen in Chrome Inspector and you will see that.

There could be a better way, but one option is that you can have two separate ng-repeat blocks, with one having the href attribute on ion-item and another one without it, like this:

Yes, I see, but it worked in older ionic versions. Thats a solution, but I would loose the lovely animations :confused:

There is one other option. You can create your own directive, like this one:

1 Like

That works like a charm!! Thank you so much :slight_smile: