mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-22 13:32:54 +08:00
fix(input): move nested function outside of if statment so as to fix 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
This commit is contained in:
@ -41,19 +41,21 @@ export class NativeInput {
|
|||||||
|
|
||||||
self.focusChange.emit(true);
|
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) {
|
if (self._blurring) {
|
||||||
// automatically blur input if:
|
// automatically blur input if:
|
||||||
// 1) this input has focus
|
// 1) this input has focus
|
||||||
// 2) the newly tapped document element is not an input
|
// 2) the newly tapped document element is not an input
|
||||||
console.debug('input blurring enabled');
|
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);
|
document.addEventListener('touchend', docTouchEnd, true);
|
||||||
self._unrefBlur = function() {
|
self._unrefBlur = function() {
|
||||||
console.debug('input blurring disabled');
|
console.debug('input blurring disabled');
|
||||||
|
Reference in New Issue
Block a user