diff --git a/ionic/components/input/native-input.ts b/ionic/components/input/native-input.ts index 7073a665e2..23aa23a030 100644 --- a/ionic/components/input/native-input.ts +++ b/ionic/components/input/native-input.ts @@ -40,20 +40,22 @@ export class NativeInput { var self = this; self.focusChange.emit(true); + + function docTouchEnd(ev) { + var tappedElement: any = ev.target; + if (tappedElement && self.element()) { + if (tappedElement.tagName !== "INPUT" && tappedElement.tagName !== "TEXTAREA") { + self.element().blur(); + } + } + } if (self._blurring) { // automatically blur input if: // 1) this input has focus // 2) the newly tapped document element is not an input console.debug('input blurring enabled'); - function docTouchEnd(ev) { - var tappedElement: any = ev.target; - if (tappedElement && self.element()) { - if (tappedElement.tagName !== 'INPUT' && tappedElement.tagName !== 'TEXTAREA') { - self.element().blur(); - } - } - } + document.addEventListener('touchend', docTouchEnd, true); self._unrefBlur = function() { console.debug('input blurring disabled');