diff --git a/ionic/components/nav/nav-controller.ts b/ionic/components/nav/nav-controller.ts
index 4941b2bfa5..11cdd621b5 100644
--- a/ionic/components/nav/nav-controller.ts
+++ b/ionic/components/nav/nav-controller.ts
@@ -851,6 +851,7 @@ export class NavController extends Ion {
if (this.keyboard.isOpen()) {
// the keyboard is still open!
// no problem, let's just close for them
+ this.keyboard.close();
this.keyboard.onClose(() => {
// keyboard has finished closing, transition complete
this._transComplete();
diff --git a/ionic/components/nav/test/basic/index.ts b/ionic/components/nav/test/basic/index.ts
index 30c88d4c27..16410a095a 100644
--- a/ionic/components/nav/test/basic/index.ts
+++ b/ionic/components/nav/test/basic/index.ts
@@ -32,6 +32,12 @@ class MyCmpTest{}
+
+
+ Text Input
+
+
+
@@ -198,15 +204,23 @@ class PrimaryHeaderPage {
Another Page Header
-
-
Back button hidden w/ ion-navbar hideBackButton
-
-
-
-
-
-
-
+
+
+
+
+ Text Input
+
+
+
+ Back button hidden w/ ion-navbar hideBackButton
+
+
+
+
+
+
+
+
`
})
diff --git a/ionic/util/form.ts b/ionic/util/form.ts
index b2c1be32bd..a3b522e627 100644
--- a/ionic/util/form.ts
+++ b/ionic/util/form.ts
@@ -51,6 +51,7 @@ export class Form {
focusOut() {
console.debug('focusOut');
+ document.activeElement && document.activeElement.blur();
this._blur.focus();
}
diff --git a/ionic/util/keyboard.ts b/ionic/util/keyboard.ts
index 8c3509ce02..189d78b184 100644
--- a/ionic/util/keyboard.ts
+++ b/ionic/util/keyboard.ts
@@ -22,7 +22,9 @@ export class Keyboard {
}
onClose(callback, pollingInternval=KEYBOARD_CLOSE_POLLING) {
+ console.debug('keyboard onClose');
const self = this;
+ let checks = 0;
let promise = null;
@@ -34,7 +36,8 @@ export class Keyboard {
self.zone.runOutsideAngular(() => {
function checkKeyboard() {
- if (!self.isOpen()) {
+ console.debug('keyboard isOpen', self.isOpen(), checks);
+ if (!self.isOpen() || checks > 100) {
rafFrames(30, () => {
self.zone.run(() => {
console.debug('keyboard closed');
@@ -45,6 +48,7 @@ export class Keyboard {
} else {
setTimeout(checkKeyboard, pollingInternval);
}
+ checks++;
}
setTimeout(checkKeyboard, pollingInternval);
@@ -54,6 +58,7 @@ export class Keyboard {
}
close() {
+ console.debug('keyboard close()');
raf(() => {
if (hasFocusedTextInput()) {
// only focus out when a text input has focus