mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 11:41:20 +08:00
@ -229,6 +229,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
|
|||||||
const LIFECYCLE_MAP: any = {
|
const LIFECYCLE_MAP: any = {
|
||||||
'ionModalDidPresent': 'ionViewDidEnter',
|
'ionModalDidPresent': 'ionViewDidEnter',
|
||||||
'ionModalWillPresent': 'ionViewWillEnter',
|
'ionModalWillPresent': 'ionViewWillEnter',
|
||||||
'ionModalWillDismiss': 'ionViewWillDismiss',
|
'ionModalWillDismiss': 'ionViewWillLeave',
|
||||||
'ionModalDidDismiss': 'ionViewDidDismiss',
|
'ionModalDidDismiss': 'ionViewDidLeave',
|
||||||
};
|
};
|
||||||
|
@ -241,6 +241,6 @@ export class Popover implements ComponentInterface, OverlayInterface {
|
|||||||
const LIFECYCLE_MAP: any = {
|
const LIFECYCLE_MAP: any = {
|
||||||
'ionPopoverDidPresent': 'ionViewDidEnter',
|
'ionPopoverDidPresent': 'ionViewDidEnter',
|
||||||
'ionPopoverWillPresent': 'ionViewWillEnter',
|
'ionPopoverWillPresent': 'ionViewWillEnter',
|
||||||
'ionPopoverWillDismiss': 'ionViewWillDismiss',
|
'ionPopoverWillDismiss': 'ionViewWillLeave',
|
||||||
'ionPopoverDidDismiss': 'ionViewDidDismiss',
|
'ionPopoverDidDismiss': 'ionViewDidLeave',
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@ import { AnimationBuilder, BackButtonEvent, HTMLIonOverlayElement, IonicConfig,
|
|||||||
let lastId = 0;
|
let lastId = 0;
|
||||||
|
|
||||||
export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts: object | undefined): Promise<T> {
|
export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts: object | undefined): Promise<T> {
|
||||||
const doc = element.ownerDocument;
|
const doc = element.ownerDocument!;
|
||||||
connectListeners(doc);
|
connectListeners(doc);
|
||||||
|
|
||||||
// convert the passed in overlay options into props
|
// convert the passed in overlay options into props
|
||||||
@ -152,16 +152,17 @@ async function overlayAnimation(
|
|||||||
}
|
}
|
||||||
if (overlay.keyboardClose) {
|
if (overlay.keyboardClose) {
|
||||||
animation.beforeAddWrite(() => {
|
animation.beforeAddWrite(() => {
|
||||||
const activeElement = baseEl.ownerDocument.activeElement as HTMLElement;
|
const activeElement = baseEl.ownerDocument!.activeElement as HTMLElement;
|
||||||
if (activeElement && activeElement.matches('input, ion-input, ion-textarea')) {
|
if (activeElement && activeElement.matches('input, ion-input, ion-textarea')) {
|
||||||
activeElement.blur();
|
activeElement.blur();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
await animation.playAsync();
|
await animation.playAsync();
|
||||||
|
const hasCompleted = animation.hasCompleted;
|
||||||
animation.destroy();
|
animation.destroy();
|
||||||
overlay.animation = undefined;
|
overlay.animation = undefined;
|
||||||
return animation.hasCompleted;
|
return hasCompleted;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user