Skip to content

Commit

Permalink
fix(input): move nested function outside of if statment so as to fix …
Browse files Browse the repository at this point in the history
…issue related to strict mode

There was a white screen issue caused on ios because of a nested function declaration in the input
component. I moved this function out of the if statement so as to fix this issue.

closes issue 187 on conference app repo
  • Loading branch information
Justin Willis authored and Justin Willis committed Apr 15, 2016
1 parent fcfd9fe commit c8e58e5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ionic/components/input/native-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit c8e58e5

Please sign in to comment.