I have a text box and a button inside an ion-item. I’m handling ng-blur on the text box to do some processing. What I notice is that when I click on the button (handled by ng-click) while the text box is still in focus, the click event fires before blur. It’s causing me problem because in the click event I’m using the result of the processing done in blur event handler.
In just Angular (and in plain JS), the blur always fires before click, as expected. In Ionic if I enclose the contents of ng-click event handler in a $timeout, it executes after ng-blur, but I feel it’s just a hack.
Why is Ionic behaving differently and what should I do to make the events fire in the right order?