Hi !
The ionic tap module contains a function called blurActive, that blurs the document’s active element when a click is detected under certain circumstances.
I experienced problems with some of my input tags and I think the problem was caused by this piece of code in particular:
if(ele.tagName === 'INPUT' || ele.tagName === 'TEXTAREA') {
ele.focus();
e.preventDefault();
} else {
blurActive();
}
Within my form labels, I added buttons that allow the user to clear the input, as can be seen in many apps.
<label class="item item-input">
<input type="email" name="email" placeholder="Email Address" ng-model="user.email">
<button class="button-icon ion-close-circled" ng-click="clearInput();" type="button"></button>
</label>
When the user clicks on the clear button, I expect to retain focus on the input. I do so by doing a focus()
on my input tag, inside my clearInput()
function.
However, the ionic code shown above apparently runs after clearInput
has been executed. Because of that, focus on input tags is lost when a user clicks on a clear button, and the keyboard goes away.
For now, I’ve solved the problem by just removing blurActive altogether from ionic.js… Could someone confirm this issue?
I tried with and without ngTouch/FastClick. I use ionic1.0.0-beta.1
Thanks!