I have the weirdest bug and no easy way to reproduce it:
I have a big app and somewhere deep down in the view hierarchy in a custom directive I have a checkbox that misbehaves, but only under Android. This checkbox was an <ion-checkbox>
initially but this even happens when I just use <input type="checkbox">
. By ‘misbehaves’ I mean that only some of the taps get recognized and result in the checkbox being (un)checked. I also have an ng-click
associated to this element which correctly fires every time I tap the checkbox.
When going back to Ionic 1.x the problem disappears. I am using a Samsung Galaxy A3 to test this.
My current resolution is to fake a checkbox item by reconstructing the parts that I need manually, like this:
<div class="item item-icon-right"
ng-click="checkItem(item)">
<h2>{{item.title}}</h2>
<i ng-show=" isChecked(item)" class="icon ion-checkmark-circled"></i>
<i ng-show="!isChecked(item)" class="icon ion-ios-circle-outline"></i>
</div>
I’m putting this up here for two reasons:
- For somebody else who encounters this problem and doesn’t want to waste a day hunting down the reason
- For the devs: Any idea what could be going on here? I don’t have enough details to make this more clear, obviously, but maybe you have a hunch.