mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 17:42:15 +08:00
This commit is contained in:
@ -54,18 +54,15 @@ export const createControllerComponent = <OptionsType extends object, OverlayTyp
|
|||||||
|
|
||||||
async present(prevProps?: Props) {
|
async present(prevProps?: Props) {
|
||||||
const { isOpen, onDidDismiss, ...cProps } = this.props;
|
const { isOpen, onDidDismiss, ...cProps } = this.props;
|
||||||
let overlay = this.overlay;
|
this.overlay = await controller.create({
|
||||||
if (!overlay) {
|
|
||||||
overlay = this.overlay = await controller.create({
|
|
||||||
...cProps as any
|
...cProps as any
|
||||||
});
|
});
|
||||||
}
|
attachProps(this.overlay, {
|
||||||
attachProps(overlay, {
|
|
||||||
[dismissEventName]: onDidDismiss
|
[dismissEventName]: onDidDismiss
|
||||||
}, prevProps);
|
}, prevProps);
|
||||||
// Check isOpen again since the value could of changed during the async call to controller.create
|
// Check isOpen again since the value could of changed during the async call to controller.create
|
||||||
if (this.props.isOpen === true) {
|
if (this.props.isOpen === true) {
|
||||||
await overlay.present();
|
await this.overlay.present();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user