mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
@ -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();
|
||||
|
@ -32,6 +32,12 @@ class MyCmpTest{}
|
||||
<button ion-item class="e2eFrom1To2" (click)="pushFullPage()">Push to FullPage</button>
|
||||
<button ion-item (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</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" [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>
|
||||
@ -198,15 +204,23 @@ class PrimaryHeaderPage {
|
||||
<ion-navbar *navbar hideBackButton>
|
||||
<ion-title>Another Page Header</ion-title>
|
||||
</ion-navbar>
|
||||
<ion-content padding>
|
||||
<p>Back button hidden w/ <code>ion-navbar hideBackButton</code></p>
|
||||
<p><button (click)="nav.pop()">Pop</button></p>
|
||||
<p><button (click)="pushFullPage()">Push to FullPage</button></p>
|
||||
<p><button (click)="pushPrimaryHeaderPage()">Push to PrimaryHeaderPage</button></p>
|
||||
<p><button (click)="pushFirstPage()">Push to FirstPage</button></p>
|
||||
<p><button (click)="setRoot()">setRoot(FirstPage)</button></p>
|
||||
<p><button (click)="toggleBackButton()">Toggle hideBackButton</button></p>
|
||||
<p><button (click)="setBackButtonText()">Set Back Button Text</button></p>
|
||||
<ion-content>
|
||||
<ion-list>
|
||||
|
||||
<ion-input>
|
||||
<ion-label>Text Input</ion-label>
|
||||
<textarea></textarea>
|
||||
</ion-input>
|
||||
|
||||
<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>
|
||||
`
|
||||
})
|
||||
|
@ -51,6 +51,7 @@ export class Form {
|
||||
|
||||
focusOut() {
|
||||
console.debug('focusOut');
|
||||
document.activeElement && document.activeElement.blur();
|
||||
this._blur.focus();
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user