mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 11:17:19 +08:00
@ -851,6 +851,7 @@ export class NavController extends Ion {
|
|||||||
if (this.keyboard.isOpen()) {
|
if (this.keyboard.isOpen()) {
|
||||||
// the keyboard is still open!
|
// the keyboard is still open!
|
||||||
// no problem, let's just close for them
|
// no problem, let's just close for them
|
||||||
|
this.keyboard.close();
|
||||||
this.keyboard.onClose(() => {
|
this.keyboard.onClose(() => {
|
||||||
// keyboard has finished closing, transition complete
|
// keyboard has finished closing, transition complete
|
||||||
this._transComplete();
|
this._transComplete();
|
||||||
|
@ -32,6 +32,12 @@ class MyCmpTest{}
|
|||||||
<button ion-item class="e2eFrom1To2" (click)="pushFullPage()">Push to FullPage</button>
|
<button ion-item class="e2eFrom1To2" (click)="pushFullPage()">Push to FullPage</button>
|
||||||
<button ion-item (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</button>
|
<button ion-item (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</button>
|
||||||
<button ion-item (click)="pushAnother()">Push to AnotherPage</button>
|
<button ion-item (click)="pushAnother()">Push to AnotherPage</button>
|
||||||
|
|
||||||
|
<ion-input>
|
||||||
|
<ion-label>Text Input</ion-label>
|
||||||
|
<textarea></textarea>
|
||||||
|
</ion-input>
|
||||||
|
|
||||||
<button ion-item [navPush]="[pushPage, {id: 42}]">Push FullPage w/ [navPush] array</button>
|
<button ion-item [navPush]="[pushPage, {id: 42}]">Push FullPage w/ [navPush] array</button>
|
||||||
<button ion-item [navPush]="pushPage" [navParams]="{id:40}">Push w/ [navPush] and [navParams]</button>
|
<button ion-item [navPush]="pushPage" [navParams]="{id:40}">Push w/ [navPush] and [navParams]</button>
|
||||||
<button ion-item [navPush]="[\'FirstPage\', {id: 22}]">Push w/ [navPush] array and string view name</button>
|
<button ion-item [navPush]="[\'FirstPage\', {id: 22}]">Push w/ [navPush] array and string view name</button>
|
||||||
@ -198,15 +204,23 @@ class PrimaryHeaderPage {
|
|||||||
<ion-navbar *navbar hideBackButton>
|
<ion-navbar *navbar hideBackButton>
|
||||||
<ion-title>Another Page Header</ion-title>
|
<ion-title>Another Page Header</ion-title>
|
||||||
</ion-navbar>
|
</ion-navbar>
|
||||||
<ion-content padding>
|
<ion-content>
|
||||||
<p>Back button hidden w/ <code>ion-navbar hideBackButton</code></p>
|
<ion-list>
|
||||||
<p><button (click)="nav.pop()">Pop</button></p>
|
|
||||||
<p><button (click)="pushFullPage()">Push to FullPage</button></p>
|
<ion-input>
|
||||||
<p><button (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</button></p>
|
<ion-label>Text Input</ion-label>
|
||||||
<p><button (click)="pushFirstPage()">Push to FirstPage</button></p>
|
<textarea></textarea>
|
||||||
<p><button (click)="setRoot()">setRoot(FirstPage)</button></p>
|
</ion-input>
|
||||||
<p><button (click)="toggleBackButton()">Toggle hideBackButton</button></p>
|
|
||||||
<p><button (click)="setBackButtonText()">Set Back Button Text</button></p>
|
<ion-item>Back button hidden w/ <code>ion-navbar hideBackButton</code></ion-item>
|
||||||
|
<button ion-item (click)="nav.pop()">Pop</button>
|
||||||
|
<button ion-item (click)="pushFullPage()">Push to FullPage</button>
|
||||||
|
<button ion-item (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</button>
|
||||||
|
<button ion-item (click)="pushFirstPage()">Push to FirstPage</button>
|
||||||
|
<button ion-item (click)="setRoot()">setRoot(FirstPage)</button>
|
||||||
|
<button ion-item (click)="toggleBackButton()">Toggle hideBackButton</button>
|
||||||
|
<button ion-item (click)="setBackButtonText()">Set Back Button Text</button>
|
||||||
|
</ion-list>
|
||||||
</ion-content>
|
</ion-content>
|
||||||
`
|
`
|
||||||
})
|
})
|
||||||
|
@ -51,6 +51,7 @@ export class Form {
|
|||||||
|
|
||||||
focusOut() {
|
focusOut() {
|
||||||
console.debug('focusOut');
|
console.debug('focusOut');
|
||||||
|
document.activeElement && document.activeElement.blur();
|
||||||
this._blur.focus();
|
this._blur.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,9 @@ export class Keyboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onClose(callback, pollingInternval=KEYBOARD_CLOSE_POLLING) {
|
onClose(callback, pollingInternval=KEYBOARD_CLOSE_POLLING) {
|
||||||
|
console.debug('keyboard onClose');
|
||||||
const self = this;
|
const self = this;
|
||||||
|
let checks = 0;
|
||||||
|
|
||||||
let promise = null;
|
let promise = null;
|
||||||
|
|
||||||
@ -34,7 +36,8 @@ export class Keyboard {
|
|||||||
self.zone.runOutsideAngular(() => {
|
self.zone.runOutsideAngular(() => {
|
||||||
|
|
||||||
function checkKeyboard() {
|
function checkKeyboard() {
|
||||||
if (!self.isOpen()) {
|
console.debug('keyboard isOpen', self.isOpen(), checks);
|
||||||
|
if (!self.isOpen() || checks > 100) {
|
||||||
rafFrames(30, () => {
|
rafFrames(30, () => {
|
||||||
self.zone.run(() => {
|
self.zone.run(() => {
|
||||||
console.debug('keyboard closed');
|
console.debug('keyboard closed');
|
||||||
@ -45,6 +48,7 @@ export class Keyboard {
|
|||||||
} else {
|
} else {
|
||||||
setTimeout(checkKeyboard, pollingInternval);
|
setTimeout(checkKeyboard, pollingInternval);
|
||||||
}
|
}
|
||||||
|
checks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
setTimeout(checkKeyboard, pollingInternval);
|
setTimeout(checkKeyboard, pollingInternval);
|
||||||
@ -54,6 +58,7 @@ export class Keyboard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
console.debug('keyboard close()');
|
||||||
raf(() => {
|
raf(() => {
|
||||||
if (hasFocusedTextInput()) {
|
if (hasFocusedTextInput()) {
|
||||||
// only focus out when a text input has focus
|
// only focus out when a text input has focus
|
||||||
|
Reference in New Issue
Block a user