fix(overlays): make them hidden until presented (#16903)

fixes #16685
This commit is contained in:
Manu MA
2018-12-29 01:31:33 +01:00
committed by GitHub
parent 3d656ac312
commit 302be5392c
25 changed files with 35 additions and 219 deletions

View File

@ -21,9 +21,7 @@ ion-action-sheet,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetai
ion-action-sheet,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-action-sheet,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-action-sheet,method,present,present() => Promise<void> ion-action-sheet,method,present,present() => Promise<void>
ion-action-sheet,event,ionActionSheetDidDismiss,OverlayEventDetail,true ion-action-sheet,event,ionActionSheetDidDismiss,OverlayEventDetail,true
ion-action-sheet,event,ionActionSheetDidLoad,void,true
ion-action-sheet,event,ionActionSheetDidPresent,void,true ion-action-sheet,event,ionActionSheetDidPresent,void,true
ion-action-sheet,event,ionActionSheetDidUnload,void,true
ion-action-sheet,event,ionActionSheetWillDismiss,OverlayEventDetail,true ion-action-sheet,event,ionActionSheetWillDismiss,OverlayEventDetail,true
ion-action-sheet,event,ionActionSheetWillPresent,void,true ion-action-sheet,event,ionActionSheetWillPresent,void,true
ion-action-sheet,css-prop,--background ion-action-sheet,css-prop,--background
@ -61,9 +59,7 @@ ion-alert,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-alert,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-alert,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-alert,method,present,present() => Promise<void> ion-alert,method,present,present() => Promise<void>
ion-alert,event,ionAlertDidDismiss,OverlayEventDetail,true ion-alert,event,ionAlertDidDismiss,OverlayEventDetail,true
ion-alert,event,ionAlertDidLoad,void,true
ion-alert,event,ionAlertDidPresent,void,true ion-alert,event,ionAlertDidPresent,void,true
ion-alert,event,ionAlertDidUnload,void,true
ion-alert,event,ionAlertWillDismiss,OverlayEventDetail,true ion-alert,event,ionAlertWillDismiss,OverlayEventDetail,true
ion-alert,event,ionAlertWillPresent,void,true ion-alert,event,ionAlertWillPresent,void,true
ion-alert,css-prop,--background ion-alert,css-prop,--background
@ -553,9 +549,7 @@ ion-loading,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any
ion-loading,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-loading,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-loading,method,present,present() => Promise<void> ion-loading,method,present,present() => Promise<void>
ion-loading,event,ionLoadingDidDismiss,OverlayEventDetail,true ion-loading,event,ionLoadingDidDismiss,OverlayEventDetail,true
ion-loading,event,ionLoadingDidLoad,void,true
ion-loading,event,ionLoadingDidPresent,void,true ion-loading,event,ionLoadingDidPresent,void,true
ion-loading,event,ionLoadingDidUnload,void,true
ion-loading,event,ionLoadingWillDismiss,OverlayEventDetail,true ion-loading,event,ionLoadingWillDismiss,OverlayEventDetail,true
ion-loading,event,ionLoadingWillPresent,void,true ion-loading,event,ionLoadingWillPresent,void,true
ion-loading,css-prop,--background ion-loading,css-prop,--background
@ -639,9 +633,7 @@ ion-modal,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-modal,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-modal,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-modal,method,present,present() => Promise<void> ion-modal,method,present,present() => Promise<void>
ion-modal,event,ionModalDidDismiss,OverlayEventDetail,true ion-modal,event,ionModalDidDismiss,OverlayEventDetail,true
ion-modal,event,ionModalDidLoad,void,true
ion-modal,event,ionModalDidPresent,void,true ion-modal,event,ionModalDidPresent,void,true
ion-modal,event,ionModalDidUnload,void,true
ion-modal,event,ionModalWillDismiss,OverlayEventDetail,true ion-modal,event,ionModalWillDismiss,OverlayEventDetail,true
ion-modal,event,ionModalWillPresent,void,true ion-modal,event,ionModalWillPresent,void,true
ion-modal,css-prop,--background ion-modal,css-prop,--background
@ -719,9 +711,7 @@ ion-picker,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>
ion-picker,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-picker,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-picker,method,present,present() => Promise<void> ion-picker,method,present,present() => Promise<void>
ion-picker,event,ionPickerDidDismiss,OverlayEventDetail,true ion-picker,event,ionPickerDidDismiss,OverlayEventDetail,true
ion-picker,event,ionPickerDidLoad,void,true
ion-picker,event,ionPickerDidPresent,void,true ion-picker,event,ionPickerDidPresent,void,true
ion-picker,event,ionPickerDidUnload,void,true
ion-picker,event,ionPickerWillDismiss,OverlayEventDetail,true ion-picker,event,ionPickerWillDismiss,OverlayEventDetail,true
ion-picker,event,ionPickerWillPresent,void,true ion-picker,event,ionPickerWillPresent,void,true
ion-picker,css-prop,--background ion-picker,css-prop,--background
@ -760,9 +750,7 @@ ion-popover,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any
ion-popover,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-popover,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-popover,method,present,present() => Promise<void> ion-popover,method,present,present() => Promise<void>
ion-popover,event,ionPopoverDidDismiss,OverlayEventDetail,true ion-popover,event,ionPopoverDidDismiss,OverlayEventDetail,true
ion-popover,event,ionPopoverDidLoad,void,true
ion-popover,event,ionPopoverDidPresent,void,true ion-popover,event,ionPopoverDidPresent,void,true
ion-popover,event,ionPopoverDidUnload,void,true
ion-popover,event,ionPopoverWillDismiss,OverlayEventDetail,true ion-popover,event,ionPopoverWillDismiss,OverlayEventDetail,true
ion-popover,event,ionPopoverWillPresent,void,true ion-popover,event,ionPopoverWillPresent,void,true
ion-popover,css-prop,--background ion-popover,css-prop,--background
@ -1162,9 +1150,7 @@ ion-toast,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
ion-toast,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>> ion-toast,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
ion-toast,method,present,present() => Promise<void> ion-toast,method,present,present() => Promise<void>
ion-toast,event,ionToastDidDismiss,OverlayEventDetail,true ion-toast,event,ionToastDidDismiss,OverlayEventDetail,true
ion-toast,event,ionToastDidLoad,void,true
ion-toast,event,ionToastDidPresent,void,true ion-toast,event,ionToastDidPresent,void,true
ion-toast,event,ionToastDidUnload,void,true
ion-toast,event,ionToastWillDismiss,OverlayEventDetail,true ion-toast,event,ionToastWillDismiss,OverlayEventDetail,true
ion-toast,event,ionToastWillPresent,void,true ion-toast,event,ionToastWillPresent,void,true
ion-toast,css-prop,--background ion-toast,css-prop,--background

View File

@ -202,18 +202,10 @@ export namespace Components {
*/ */
'onIonActionSheetDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonActionSheetDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the alert has loaded.
*/
'onIonActionSheetDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the alert has presented. * Emitted after the alert has presented.
*/ */
'onIonActionSheetDidPresent'?: (event: CustomEvent<void>) => void; 'onIonActionSheetDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the alert has unloaded.
*/
'onIonActionSheetDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the alert has dismissed. * Emitted before the alert has dismissed.
*/ */
'onIonActionSheetWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonActionSheetWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -371,16 +363,8 @@ export namespace Components {
/** /**
* Emitted after the alert has presented. * Emitted after the alert has presented.
*/ */
'onIonAlertDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the alert has presented.
*/
'onIonAlertDidPresent'?: (event: CustomEvent<void>) => void; 'onIonAlertDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted before the alert has presented.
*/
'onIonAlertDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the alert has dismissed. * Emitted before the alert has dismissed.
*/ */
'onIonAlertWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonAlertWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -2298,18 +2282,10 @@ export namespace Components {
*/ */
'onIonLoadingDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonLoadingDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the loading has loaded.
*/
'onIonLoadingDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the loading has presented. * Emitted after the loading has presented.
*/ */
'onIonLoadingDidPresent'?: (event: CustomEvent<void>) => void; 'onIonLoadingDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the loading has unloaded.
*/
'onIonLoadingDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the loading has dismissed. * Emitted before the loading has dismissed.
*/ */
'onIonLoadingWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonLoadingWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -2667,18 +2643,10 @@ export namespace Components {
*/ */
'onIonModalDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonModalDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the modal has loaded.
*/
'onIonModalDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the modal has presented. * Emitted after the modal has presented.
*/ */
'onIonModalDidPresent'?: (event: CustomEvent<void>) => void; 'onIonModalDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the modal has unloaded.
*/
'onIonModalDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the modal has dismissed. * Emitted before the modal has dismissed.
*/ */
'onIonModalWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonModalWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -3008,18 +2976,10 @@ export namespace Components {
*/ */
'onIonPickerDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonPickerDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the picker has loaded.
*/
'onIonPickerDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the picker has presented. * Emitted after the picker has presented.
*/ */
'onIonPickerDidPresent'?: (event: CustomEvent<void>) => void; 'onIonPickerDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the picker has unloaded.
*/
'onIonPickerDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the picker has dismissed. * Emitted before the picker has dismissed.
*/ */
'onIonPickerWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonPickerWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -3165,18 +3125,10 @@ export namespace Components {
*/ */
'onIonPopoverDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonPopoverDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the popover has loaded.
*/
'onIonPopoverDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the popover has presented. * Emitted after the popover has presented.
*/ */
'onIonPopoverDidPresent'?: (event: CustomEvent<void>) => void; 'onIonPopoverDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the popover has unloaded.
*/
'onIonPopoverDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the popover has dismissed. * Emitted before the popover has dismissed.
*/ */
'onIonPopoverWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonPopoverWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@ -4946,18 +4898,10 @@ export namespace Components {
*/ */
'onIonToastDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonToastDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
/** /**
* Emitted after the toast has loaded.
*/
'onIonToastDidLoad'?: (event: CustomEvent<void>) => void;
/**
* Emitted after the toast has presented. * Emitted after the toast has presented.
*/ */
'onIonToastDidPresent'?: (event: CustomEvent<void>) => void; 'onIonToastDidPresent'?: (event: CustomEvent<void>) => void;
/** /**
* Emitted after the toast has unloaded.
*/
'onIonToastDidUnload'?: (event: CustomEvent<void>) => void;
/**
* Emitted before the toast has dismissed. * Emitted before the toast has dismissed.
*/ */
'onIonToastWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void; 'onIonToastWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;

View File

@ -39,6 +39,10 @@
z-index: $z-index-overlay; z-index: $z-index-overlay;
} }
:host(.overlay-hidden) {
display: none;
}
.action-sheet-wrapper { .action-sheet-wrapper {
@include position(null, 0, 0, 0); @include position(null, 0, 0, 0);
@include margin(auto); @include margin(auto);

View File

@ -84,16 +84,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the alert has loaded.
*/
@Event() ionActionSheetDidLoad!: EventEmitter<void>;
/**
* Emitted after the alert has unloaded.
*/
@Event() ionActionSheetDidUnload!: EventEmitter<void>;
/** /**
* Emitted after the alert has presented. * Emitted after the alert has presented.
*/ */
@ -114,14 +104,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
*/ */
@Event({ eventName: 'ionActionSheetDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>; @Event({ eventName: 'ionActionSheetDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
componentDidLoad() {
this.ionActionSheetDidLoad.emit();
}
componentDidUnload() {
this.ionActionSheetDidUnload.emit();
}
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
this.dismiss(undefined, BACKDROP); this.dismiss(undefined, BACKDROP);

View File

@ -146,9 +146,7 @@ async function presentActionSheet() {
| Event | Description | Type | | Event | Description | Type |
| --------------------------- | --------------------------------------- | --------------------------------- | | --------------------------- | --------------------------------------- | --------------------------------- |
| `ionActionSheetDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionActionSheetDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionActionSheetDidLoad` | Emitted after the alert has loaded. | `CustomEvent<void>` |
| `ionActionSheetDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` | | `ionActionSheetDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` |
| `ionActionSheetDidUnload` | Emitted after the alert has unloaded. | `CustomEvent<void>` |
| `ionActionSheetWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionActionSheetWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionActionSheetWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` | | `ionActionSheetWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` |

View File

@ -38,6 +38,10 @@
z-index: $z-index-overlay; z-index: $z-index-overlay;
} }
:host(.overlay-hidden) {
display: none;
}
:host(.alert-top) { :host(.alert-top) {
@include padding(50px, null, null, null); @include padding(50px, null, null, null);

View File

@ -100,16 +100,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the alert has presented.
*/
@Event() ionAlertDidLoad!: EventEmitter<void>;
/**
* Emitted before the alert has presented.
*/
@Event() ionAlertDidUnload!: EventEmitter<void>;
/** /**
* Emitted after the alert has presented. * Emitted after the alert has presented.
*/ */
@ -171,14 +161,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
this.buttonsChanged(); this.buttonsChanged();
} }
componentDidLoad() {
this.ionAlertDidLoad.emit();
}
componentDidUnload() {
this.ionAlertDidUnload.emit();
}
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
this.dismiss(undefined, BACKDROP); this.dismiss(undefined, BACKDROP);

View File

@ -551,9 +551,7 @@ async function presentAlertCheckbox() {
| Event | Description | Type | | Event | Description | Type |
| --------------------- | --------------------------------------- | --------------------------------- | | --------------------- | --------------------------------------- | --------------------------------- |
| `ionAlertDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionAlertDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionAlertDidLoad` | Emitted after the alert has presented. | `CustomEvent<void>` |
| `ionAlertDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` | | `ionAlertDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` |
| `ionAlertDidUnload` | Emitted before the alert has presented. | `CustomEvent<void>` |
| `ionAlertWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionAlertWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionAlertWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` | | `ionAlertWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` |

View File

@ -39,6 +39,10 @@
z-index: $z-index-overlay; z-index: $z-index-overlay;
} }
:host(.overlay-hidden) {
display: none;
}
.loading-wrapper { .loading-wrapper {
display: flex; display: flex;

View File

@ -91,16 +91,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the loading has unloaded.
*/
@Event() ionLoadingDidUnload!: EventEmitter<void>;
/**
* Emitted after the loading has loaded.
*/
@Event() ionLoadingDidLoad!: EventEmitter<void>;
/** /**
* Emitted after the loading has presented. * Emitted after the loading has presented.
*/ */
@ -127,14 +117,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
} }
} }
componentDidLoad() {
this.ionLoadingDidLoad.emit();
}
componentDidUnload() {
this.ionLoadingDidUnload.emit();
}
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
this.dismiss(undefined, BACKDROP); this.dismiss(undefined, BACKDROP);

View File

@ -108,9 +108,7 @@ async function presentLoadingWithOptions() {
| Event | Description | Type | | Event | Description | Type |
| ----------------------- | ----------------------------------------- | --------------------------------- | | ----------------------- | ----------------------------------------- | --------------------------------- |
| `ionLoadingDidDismiss` | Emitted after the loading has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionLoadingDidDismiss` | Emitted after the loading has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionLoadingDidLoad` | Emitted after the loading has loaded. | `CustomEvent<void>` |
| `ionLoadingDidPresent` | Emitted after the loading has presented. | `CustomEvent<void>` | | `ionLoadingDidPresent` | Emitted after the loading has presented. | `CustomEvent<void>` |
| `ionLoadingDidUnload` | Emitted after the loading has unloaded. | `CustomEvent<void>` |
| `ionLoadingWillDismiss` | Emitted before the loading has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionLoadingWillDismiss` | Emitted before the loading has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionLoadingWillPresent` | Emitted before the loading has presented. | `CustomEvent<void>` | | `ionLoadingWillPresent` | Emitted before the loading has presented. | `CustomEvent<void>` |

View File

@ -10,8 +10,6 @@
color: var(--color); color: var(--color);
pointer-events: all;
text-align: center; text-align: center;
text-decoration: none; text-decoration: none;
text-overflow: ellipsis; text-overflow: ellipsis;

View File

@ -46,6 +46,10 @@
contain: strict; contain: strict;
} }
:host(.overlay-hidden) {
display: none;
}
.modal-wrapper { .modal-wrapper {
@include border-radius(var(--border-radius)); @include border-radius(var(--border-radius));

View File

@ -23,8 +23,8 @@ export class Modal implements ComponentInterface, OverlayInterface {
private usersElement?: HTMLElement; private usersElement?: HTMLElement;
animation: Animation | undefined;
presented = false; presented = false;
animation: Animation | undefined;
@Element() el!: HTMLElement; @Element() el!: HTMLElement;
@ -87,16 +87,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the modal has loaded.
*/
@Event() ionModalDidLoad!: EventEmitter<void>;
/**
* Emitted after the modal has unloaded.
*/
@Event() ionModalDidUnload!: EventEmitter<void>;
/** /**
* Emitted after the modal has presented. * Emitted after the modal has presented.
*/ */
@ -117,14 +107,6 @@ export class Modal implements ComponentInterface, OverlayInterface {
*/ */
@Event({ eventName: 'ionModalDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>; @Event({ eventName: 'ionModalDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
componentDidLoad() {
this.ionModalDidLoad.emit();
}
componentDidUnload() {
this.ionModalDidUnload.emit();
}
@Listen('ionDismiss') @Listen('ionDismiss')
protected onDismiss(ev: UIEvent) { protected onDismiss(ev: UIEvent) {
ev.stopPropagation(); ev.stopPropagation();

View File

@ -162,9 +162,7 @@ async function presentModal() {
| Event | Description | Type | | Event | Description | Type |
| --------------------- | --------------------------------------- | --------------------------------- | | --------------------- | --------------------------------------- | --------------------------------- |
| `ionModalDidDismiss` | Emitted after the modal has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionModalDidDismiss` | Emitted after the modal has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionModalDidLoad` | Emitted after the modal has loaded. | `CustomEvent<void>` |
| `ionModalDidPresent` | Emitted after the modal has presented. | `CustomEvent<void>` | | `ionModalDidPresent` | Emitted after the modal has presented. | `CustomEvent<void>` |
| `ionModalDidUnload` | Emitted after the modal has unloaded. | `CustomEvent<void>` |
| `ionModalWillDismiss` | Emitted before the modal has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionModalWillDismiss` | Emitted before the modal has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionModalWillPresent` | Emitted before the modal has presented. | `CustomEvent<void>` | | `ionModalWillPresent` | Emitted before the modal has presented. | `CustomEvent<void>` |

View File

@ -45,6 +45,10 @@
z-index: $z-index-overlay; z-index: $z-index-overlay;
} }
:host(.overlay-hidden) {
display: none;
}
.picker-wrapper { .picker-wrapper {
@include border-radius(var(--border-radius)); @include border-radius(var(--border-radius));
@include position(null, 0, 0, 0); @include position(null, 0, 0, 0);

View File

@ -1,4 +1,4 @@
import { Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop } from '@stencil/core'; import { Component, ComponentInterface, Element, Event, EventEmitter, Listen, Method, Prop, State } from '@stencil/core';
import { Animation, AnimationBuilder, Config, CssClassMap, Mode, OverlayEventDetail, OverlayInterface, PickerButton, PickerColumn } from '../../interface'; import { Animation, AnimationBuilder, Config, CssClassMap, Mode, OverlayEventDetail, OverlayInterface, PickerButton, PickerColumn } from '../../interface';
import { dismiss, eventMethod, present } from '../../utils/overlays'; import { dismiss, eventMethod, present } from '../../utils/overlays';
@ -18,13 +18,14 @@ import { iosLeaveAnimation } from './animations/ios.leave';
export class Picker implements ComponentInterface, OverlayInterface { export class Picker implements ComponentInterface, OverlayInterface {
private durationTimeout: any; private durationTimeout: any;
presented = false;
animation?: Animation; animation?: Animation;
@Element() el!: HTMLElement; @Element() el!: HTMLElement;
@Prop({ context: 'config' }) config!: Config; @Prop({ context: 'config' }) config!: Config;
@State() presented = false;
/** @internal */ /** @internal */
@Prop() overlayIndex!: number; @Prop() overlayIndex!: number;
@ -84,11 +85,6 @@ export class Picker implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the picker has loaded.
*/
@Event() ionPickerDidLoad!: EventEmitter<void>;
/** /**
* Emitted after the picker has presented. * Emitted after the picker has presented.
*/ */
@ -109,19 +105,6 @@ export class Picker implements ComponentInterface, OverlayInterface {
*/ */
@Event({ eventName: 'ionPickerDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>; @Event({ eventName: 'ionPickerDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
/**
* Emitted after the picker has unloaded.
*/
@Event() ionPickerDidUnload!: EventEmitter<void>;
componentDidLoad() {
this.ionPickerDidLoad.emit();
}
componentDidUnload() {
this.ionPickerDidUnload.emit();
}
@Listen('ionBackdropTap') @Listen('ionBackdropTap')
protected onBackdropTap() { protected onBackdropTap() {
const cancelBtn = this.buttons.find(b => b.role === 'cancel'); const cancelBtn = this.buttons.find(b => b.role === 'cancel');
@ -253,7 +236,7 @@ export class Picker implements ComponentInterface, OverlayInterface {
<div class="picker-columns"> <div class="picker-columns">
<div class="picker-above-highlight"></div> <div class="picker-above-highlight"></div>
{this.columns.map(c => {this.presented && this.columns.map(c =>
<ion-picker-column col={c}></ion-picker-column> <ion-picker-column col={c}></ion-picker-column>
)} )}
<div class="picker-below-highlight"></div> <div class="picker-below-highlight"></div>

View File

@ -29,9 +29,7 @@ A Picker is a dialog that displays a row of buttons and columns underneath. It a
| Event | Description | Type | | Event | Description | Type |
| ---------------------- | ---------------------------------------- | --------------------------------- | | ---------------------- | ---------------------------------------- | --------------------------------- |
| `ionPickerDidDismiss` | Emitted after the picker has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionPickerDidDismiss` | Emitted after the picker has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionPickerDidLoad` | Emitted after the picker has loaded. | `CustomEvent<void>` |
| `ionPickerDidPresent` | Emitted after the picker has presented. | `CustomEvent<void>` | | `ionPickerDidPresent` | Emitted after the picker has presented. | `CustomEvent<void>` |
| `ionPickerDidUnload` | Emitted after the picker has unloaded. | `CustomEvent<void>` |
| `ionPickerWillDismiss` | Emitted before the picker has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionPickerWillDismiss` | Emitted before the picker has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionPickerWillPresent` | Emitted before the picker has presented. | `CustomEvent<void>` | | `ionPickerWillPresent` | Emitted before the picker has presented. | `CustomEvent<void>` |

View File

@ -35,6 +35,10 @@
z-index: $z-index-overlay; z-index: $z-index-overlay;
} }
:host(.overlay-hidden) {
display: none;
}
.popover-wrapper { .popover-wrapper {
opacity: 0; opacity: 0;
z-index: $z-index-overlay-wrapper; z-index: $z-index-overlay-wrapper;

View File

@ -97,16 +97,6 @@ export class Popover implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the popover has loaded.
*/
@Event() ionPopoverDidLoad!: EventEmitter<void>;
/**
* Emitted after the popover has unloaded.
*/
@Event() ionPopoverDidUnload!: EventEmitter<void>;
/** /**
* Emitted after the popover has presented. * Emitted after the popover has presented.
*/ */
@ -127,14 +117,6 @@ export class Popover implements ComponentInterface, OverlayInterface {
*/ */
@Event({ eventName: 'ionPopoverDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>; @Event({ eventName: 'ionPopoverDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
componentDidLoad() {
this.ionPopoverDidLoad.emit();
}
componentDidUnload() {
this.ionPopoverDidUnload.emit();
}
@Listen('ionDismiss') @Listen('ionDismiss')
protected onDismiss(ev: UIEvent) { protected onDismiss(ev: UIEvent) {
ev.stopPropagation(); ev.stopPropagation();
@ -215,7 +197,6 @@ export class Popover implements ComponentInterface, OverlayInterface {
} }
hostData() { hostData() {
return { return {
style: { style: {
zIndex: 20000 + this.overlayIndex, zIndex: 20000 + this.overlayIndex,

View File

@ -84,9 +84,7 @@ async function presentPopover(ev) {
| Event | Description | Type | | Event | Description | Type |
| ----------------------- | ----------------------------------------- | --------------------------------- | | ----------------------- | ----------------------------------------- | --------------------------------- |
| `ionPopoverDidDismiss` | Emitted after the popover has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionPopoverDidDismiss` | Emitted after the popover has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionPopoverDidLoad` | Emitted after the popover has loaded. | `CustomEvent<void>` |
| `ionPopoverDidPresent` | Emitted after the popover has presented. | `CustomEvent<void>` | | `ionPopoverDidPresent` | Emitted after the popover has presented. | `CustomEvent<void>` |
| `ionPopoverDidUnload` | Emitted after the popover has unloaded. | `CustomEvent<void>` |
| `ionPopoverWillDismiss` | Emitted before the popover has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionPopoverWillDismiss` | Emitted before the popover has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionPopoverWillPresent` | Emitted before the popover has presented. | `CustomEvent<void>` | | `ionPopoverWillPresent` | Emitted before the popover has presented. | `CustomEvent<void>` |

View File

@ -111,9 +111,7 @@ async function presentToastWithOptions() {
| Event | Description | Type | | Event | Description | Type |
| --------------------- | --------------------------------------- | --------------------------------- | | --------------------- | --------------------------------------- | --------------------------------- |
| `ionToastDidDismiss` | Emitted after the toast has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionToastDidDismiss` | Emitted after the toast has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionToastDidLoad` | Emitted after the toast has loaded. | `CustomEvent<void>` |
| `ionToastDidPresent` | Emitted after the toast has presented. | `CustomEvent<void>` | | `ionToastDidPresent` | Emitted after the toast has presented. | `CustomEvent<void>` |
| `ionToastDidUnload` | Emitted after the toast has unloaded. | `CustomEvent<void>` |
| `ionToastWillDismiss` | Emitted before the toast has dismissed. | `CustomEvent<OverlayEventDetail>` | | `ionToastWillDismiss` | Emitted before the toast has dismissed. | `CustomEvent<OverlayEventDetail>` |
| `ionToastWillPresent` | Emitted before the toast has presented. | `CustomEvent<void>` | | `ionToastWillPresent` | Emitted before the toast has presented. | `CustomEvent<void>` |

View File

@ -52,6 +52,10 @@
pointer-events: none; pointer-events: none;
} }
:host(.overlay-hidden) {
display: none;
}
:host(.ion-color) { :host(.ion-color) {
--button-color: inherit; --button-color: inherit;

View File

@ -103,11 +103,6 @@ export class Toast implements ComponentInterface, OverlayInterface {
*/ */
@Prop() animated = true; @Prop() animated = true;
/**
* Emitted after the toast has loaded.
*/
@Event() ionToastDidLoad!: EventEmitter<void>;
/** /**
* Emitted after the toast has presented. * Emitted after the toast has presented.
*/ */
@ -128,19 +123,6 @@ export class Toast implements ComponentInterface, OverlayInterface {
*/ */
@Event({ eventName: 'ionToastDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>; @Event({ eventName: 'ionToastDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
/**
* Emitted after the toast has unloaded.
*/
@Event() ionToastDidUnload!: EventEmitter<void>;
componentDidLoad() {
this.ionToastDidLoad.emit();
}
componentDidUnload() {
this.ionToastDidUnload.emit();
}
/** /**
* Present the toast overlay after it has been created. * Present the toast overlay after it has been created.
*/ */

View File

@ -9,7 +9,7 @@ export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts:
// convert the passed in overlay options into props // convert the passed in overlay options into props
// that get passed down into the new overlay // that get passed down into the new overlay
Object.assign(element, opts); Object.assign(element, opts);
element.classList.add('ion-page-invisible'); element.classList.add('overlay-hidden');
const overlayIndex = lastId++; const overlayIndex = lastId++;
element.overlayIndex = overlayIndex; element.overlayIndex = overlayIndex;
if (!element.hasAttribute('id')) { if (!element.hasAttribute('id')) {
@ -142,7 +142,7 @@ async function overlayAnimation(
} else { } else {
// Make overlay visible in case it's hidden // Make overlay visible in case it's hidden
baseEl.classList.remove('ion-page-invisible'); baseEl.classList.remove('overlay-hidden');
const aniRoot = baseEl.shadowRoot || overlay.el; const aniRoot = baseEl.shadowRoot || overlay.el;
const animation = overlay.animation = await import('./animation').then(mod => mod.create(animationBuilder, aniRoot, opts)); const animation = overlay.animation = await import('./animation').then(mod => mod.create(animationBuilder, aniRoot, opts));