Skip to content

Commit 302be53

Browse files
authored
fix(overlays): make them hidden until presented (#16903)
fixes #16685
1 parent 3d656ac commit 302be53

25 files changed

+35
-219
lines changed

core/api.txt

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ ion-action-sheet,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetai
2121
ion-action-sheet,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
2222
ion-action-sheet,method,present,present() => Promise<void>
2323
ion-action-sheet,event,ionActionSheetDidDismiss,OverlayEventDetail,true
24-
ion-action-sheet,event,ionActionSheetDidLoad,void,true
2524
ion-action-sheet,event,ionActionSheetDidPresent,void,true
26-
ion-action-sheet,event,ionActionSheetDidUnload,void,true
2725
ion-action-sheet,event,ionActionSheetWillDismiss,OverlayEventDetail,true
2826
ion-action-sheet,event,ionActionSheetWillPresent,void,true
2927
ion-action-sheet,css-prop,--background
@@ -61,9 +59,7 @@ ion-alert,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
6159
ion-alert,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
6260
ion-alert,method,present,present() => Promise<void>
6361
ion-alert,event,ionAlertDidDismiss,OverlayEventDetail,true
64-
ion-alert,event,ionAlertDidLoad,void,true
6562
ion-alert,event,ionAlertDidPresent,void,true
66-
ion-alert,event,ionAlertDidUnload,void,true
6763
ion-alert,event,ionAlertWillDismiss,OverlayEventDetail,true
6864
ion-alert,event,ionAlertWillPresent,void,true
6965
ion-alert,css-prop,--background
@@ -553,9 +549,7 @@ ion-loading,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any
553549
ion-loading,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
554550
ion-loading,method,present,present() => Promise<void>
555551
ion-loading,event,ionLoadingDidDismiss,OverlayEventDetail,true
556-
ion-loading,event,ionLoadingDidLoad,void,true
557552
ion-loading,event,ionLoadingDidPresent,void,true
558-
ion-loading,event,ionLoadingDidUnload,void,true
559553
ion-loading,event,ionLoadingWillDismiss,OverlayEventDetail,true
560554
ion-loading,event,ionLoadingWillPresent,void,true
561555
ion-loading,css-prop,--background
@@ -639,9 +633,7 @@ ion-modal,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
639633
ion-modal,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
640634
ion-modal,method,present,present() => Promise<void>
641635
ion-modal,event,ionModalDidDismiss,OverlayEventDetail,true
642-
ion-modal,event,ionModalDidLoad,void,true
643636
ion-modal,event,ionModalDidPresent,void,true
644-
ion-modal,event,ionModalDidUnload,void,true
645637
ion-modal,event,ionModalWillDismiss,OverlayEventDetail,true
646638
ion-modal,event,ionModalWillPresent,void,true
647639
ion-modal,css-prop,--background
@@ -719,9 +711,7 @@ ion-picker,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>
719711
ion-picker,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
720712
ion-picker,method,present,present() => Promise<void>
721713
ion-picker,event,ionPickerDidDismiss,OverlayEventDetail,true
722-
ion-picker,event,ionPickerDidLoad,void,true
723714
ion-picker,event,ionPickerDidPresent,void,true
724-
ion-picker,event,ionPickerDidUnload,void,true
725715
ion-picker,event,ionPickerWillDismiss,OverlayEventDetail,true
726716
ion-picker,event,ionPickerWillPresent,void,true
727717
ion-picker,css-prop,--background
@@ -760,9 +750,7 @@ ion-popover,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any
760750
ion-popover,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
761751
ion-popover,method,present,present() => Promise<void>
762752
ion-popover,event,ionPopoverDidDismiss,OverlayEventDetail,true
763-
ion-popover,event,ionPopoverDidLoad,void,true
764753
ion-popover,event,ionPopoverDidPresent,void,true
765-
ion-popover,event,ionPopoverDidUnload,void,true
766754
ion-popover,event,ionPopoverWillDismiss,OverlayEventDetail,true
767755
ion-popover,event,ionPopoverWillPresent,void,true
768756
ion-popover,css-prop,--background
@@ -1162,9 +1150,7 @@ ion-toast,method,onDidDismiss,onDidDismiss() => Promise<OverlayEventDetail<any>>
11621150
ion-toast,method,onWillDismiss,onWillDismiss() => Promise<OverlayEventDetail<any>>
11631151
ion-toast,method,present,present() => Promise<void>
11641152
ion-toast,event,ionToastDidDismiss,OverlayEventDetail,true
1165-
ion-toast,event,ionToastDidLoad,void,true
11661153
ion-toast,event,ionToastDidPresent,void,true
1167-
ion-toast,event,ionToastDidUnload,void,true
11681154
ion-toast,event,ionToastWillDismiss,OverlayEventDetail,true
11691155
ion-toast,event,ionToastWillPresent,void,true
11701156
ion-toast,css-prop,--background

core/src/components.d.ts

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -202,18 +202,10 @@ export namespace Components {
202202
*/
203203
'onIonActionSheetDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
204204
/**
205-
* Emitted after the alert has loaded.
206-
*/
207-
'onIonActionSheetDidLoad'?: (event: CustomEvent<void>) => void;
208-
/**
209205
* Emitted after the alert has presented.
210206
*/
211207
'onIonActionSheetDidPresent'?: (event: CustomEvent<void>) => void;
212208
/**
213-
* Emitted after the alert has unloaded.
214-
*/
215-
'onIonActionSheetDidUnload'?: (event: CustomEvent<void>) => void;
216-
/**
217209
* Emitted before the alert has dismissed.
218210
*/
219211
'onIonActionSheetWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -371,16 +363,8 @@ export namespace Components {
371363
/**
372364
* Emitted after the alert has presented.
373365
*/
374-
'onIonAlertDidLoad'?: (event: CustomEvent<void>) => void;
375-
/**
376-
* Emitted after the alert has presented.
377-
*/
378366
'onIonAlertDidPresent'?: (event: CustomEvent<void>) => void;
379367
/**
380-
* Emitted before the alert has presented.
381-
*/
382-
'onIonAlertDidUnload'?: (event: CustomEvent<void>) => void;
383-
/**
384368
* Emitted before the alert has dismissed.
385369
*/
386370
'onIonAlertWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -2298,18 +2282,10 @@ export namespace Components {
22982282
*/
22992283
'onIonLoadingDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
23002284
/**
2301-
* Emitted after the loading has loaded.
2302-
*/
2303-
'onIonLoadingDidLoad'?: (event: CustomEvent<void>) => void;
2304-
/**
23052285
* Emitted after the loading has presented.
23062286
*/
23072287
'onIonLoadingDidPresent'?: (event: CustomEvent<void>) => void;
23082288
/**
2309-
* Emitted after the loading has unloaded.
2310-
*/
2311-
'onIonLoadingDidUnload'?: (event: CustomEvent<void>) => void;
2312-
/**
23132289
* Emitted before the loading has dismissed.
23142290
*/
23152291
'onIonLoadingWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -2667,18 +2643,10 @@ export namespace Components {
26672643
*/
26682644
'onIonModalDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
26692645
/**
2670-
* Emitted after the modal has loaded.
2671-
*/
2672-
'onIonModalDidLoad'?: (event: CustomEvent<void>) => void;
2673-
/**
26742646
* Emitted after the modal has presented.
26752647
*/
26762648
'onIonModalDidPresent'?: (event: CustomEvent<void>) => void;
26772649
/**
2678-
* Emitted after the modal has unloaded.
2679-
*/
2680-
'onIonModalDidUnload'?: (event: CustomEvent<void>) => void;
2681-
/**
26822650
* Emitted before the modal has dismissed.
26832651
*/
26842652
'onIonModalWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -3008,18 +2976,10 @@ export namespace Components {
30082976
*/
30092977
'onIonPickerDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
30102978
/**
3011-
* Emitted after the picker has loaded.
3012-
*/
3013-
'onIonPickerDidLoad'?: (event: CustomEvent<void>) => void;
3014-
/**
30152979
* Emitted after the picker has presented.
30162980
*/
30172981
'onIonPickerDidPresent'?: (event: CustomEvent<void>) => void;
30182982
/**
3019-
* Emitted after the picker has unloaded.
3020-
*/
3021-
'onIonPickerDidUnload'?: (event: CustomEvent<void>) => void;
3022-
/**
30232983
* Emitted before the picker has dismissed.
30242984
*/
30252985
'onIonPickerWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -3165,18 +3125,10 @@ export namespace Components {
31653125
*/
31663126
'onIonPopoverDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
31673127
/**
3168-
* Emitted after the popover has loaded.
3169-
*/
3170-
'onIonPopoverDidLoad'?: (event: CustomEvent<void>) => void;
3171-
/**
31723128
* Emitted after the popover has presented.
31733129
*/
31743130
'onIonPopoverDidPresent'?: (event: CustomEvent<void>) => void;
31753131
/**
3176-
* Emitted after the popover has unloaded.
3177-
*/
3178-
'onIonPopoverDidUnload'?: (event: CustomEvent<void>) => void;
3179-
/**
31803132
* Emitted before the popover has dismissed.
31813133
*/
31823134
'onIonPopoverWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
@@ -4946,18 +4898,10 @@ export namespace Components {
49464898
*/
49474899
'onIonToastDidDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;
49484900
/**
4949-
* Emitted after the toast has loaded.
4950-
*/
4951-
'onIonToastDidLoad'?: (event: CustomEvent<void>) => void;
4952-
/**
49534901
* Emitted after the toast has presented.
49544902
*/
49554903
'onIonToastDidPresent'?: (event: CustomEvent<void>) => void;
49564904
/**
4957-
* Emitted after the toast has unloaded.
4958-
*/
4959-
'onIonToastDidUnload'?: (event: CustomEvent<void>) => void;
4960-
/**
49614905
* Emitted before the toast has dismissed.
49624906
*/
49634907
'onIonToastWillDismiss'?: (event: CustomEvent<OverlayEventDetail>) => void;

core/src/components/action-sheet/action-sheet.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
z-index: $z-index-overlay;
4040
}
4141

42+
:host(.overlay-hidden) {
43+
display: none;
44+
}
45+
4246
.action-sheet-wrapper {
4347
@include position(null, 0, 0, 0);
4448
@include margin(auto);

core/src/components/action-sheet/action-sheet.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
8484
*/
8585
@Prop() animated = true;
8686

87-
/**
88-
* Emitted after the alert has loaded.
89-
*/
90-
@Event() ionActionSheetDidLoad!: EventEmitter<void>;
91-
92-
/**
93-
* Emitted after the alert has unloaded.
94-
*/
95-
@Event() ionActionSheetDidUnload!: EventEmitter<void>;
96-
9787
/**
9888
* Emitted after the alert has presented.
9989
*/
@@ -114,14 +104,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
114104
*/
115105
@Event({ eventName: 'ionActionSheetDidDismiss' }) didDismiss!: EventEmitter<OverlayEventDetail>;
116106

117-
componentDidLoad() {
118-
this.ionActionSheetDidLoad.emit();
119-
}
120-
121-
componentDidUnload() {
122-
this.ionActionSheetDidUnload.emit();
123-
}
124-
125107
@Listen('ionBackdropTap')
126108
protected onBackdropTap() {
127109
this.dismiss(undefined, BACKDROP);

core/src/components/action-sheet/readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,7 @@ async function presentActionSheet() {
146146
| Event | Description | Type |
147147
| --------------------------- | --------------------------------------- | --------------------------------- |
148148
| `ionActionSheetDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
149-
| `ionActionSheetDidLoad` | Emitted after the alert has loaded. | `CustomEvent<void>` |
150149
| `ionActionSheetDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` |
151-
| `ionActionSheetDidUnload` | Emitted after the alert has unloaded. | `CustomEvent<void>` |
152150
| `ionActionSheetWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
153151
| `ionActionSheetWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` |
154152

core/src/components/alert/alert.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
z-index: $z-index-overlay;
3939
}
4040

41+
:host(.overlay-hidden) {
42+
display: none;
43+
}
44+
4145
:host(.alert-top) {
4246
@include padding(50px, null, null, null);
4347

core/src/components/alert/alert.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -100,16 +100,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
100100
*/
101101
@Prop() animated = true;
102102

103-
/**
104-
* Emitted after the alert has presented.
105-
*/
106-
@Event() ionAlertDidLoad!: EventEmitter<void>;
107-
108-
/**
109-
* Emitted before the alert has presented.
110-
*/
111-
@Event() ionAlertDidUnload!: EventEmitter<void>;
112-
113103
/**
114104
* Emitted after the alert has presented.
115105
*/
@@ -171,14 +161,6 @@ export class Alert implements ComponentInterface, OverlayInterface {
171161
this.buttonsChanged();
172162
}
173163

174-
componentDidLoad() {
175-
this.ionAlertDidLoad.emit();
176-
}
177-
178-
componentDidUnload() {
179-
this.ionAlertDidUnload.emit();
180-
}
181-
182164
@Listen('ionBackdropTap')
183165
protected onBackdropTap() {
184166
this.dismiss(undefined, BACKDROP);

core/src/components/alert/readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -551,9 +551,7 @@ async function presentAlertCheckbox() {
551551
| Event | Description | Type |
552552
| --------------------- | --------------------------------------- | --------------------------------- |
553553
| `ionAlertDidDismiss` | Emitted after the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
554-
| `ionAlertDidLoad` | Emitted after the alert has presented. | `CustomEvent<void>` |
555554
| `ionAlertDidPresent` | Emitted after the alert has presented. | `CustomEvent<void>` |
556-
| `ionAlertDidUnload` | Emitted before the alert has presented. | `CustomEvent<void>` |
557555
| `ionAlertWillDismiss` | Emitted before the alert has dismissed. | `CustomEvent<OverlayEventDetail>` |
558556
| `ionAlertWillPresent` | Emitted before the alert has presented. | `CustomEvent<void>` |
559557

core/src/components/loading/loading.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
z-index: $z-index-overlay;
4040
}
4141

42+
:host(.overlay-hidden) {
43+
display: none;
44+
}
45+
4246
.loading-wrapper {
4347
display: flex;
4448

core/src/components/loading/loading.tsx

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
9191
*/
9292
@Prop() animated = true;
9393

94-
/**
95-
* Emitted after the loading has unloaded.
96-
*/
97-
@Event() ionLoadingDidUnload!: EventEmitter<void>;
98-
99-
/**
100-
* Emitted after the loading has loaded.
101-
*/
102-
@Event() ionLoadingDidLoad!: EventEmitter<void>;
103-
10494
/**
10595
* Emitted after the loading has presented.
10696
*/
@@ -127,14 +117,6 @@ export class Loading implements ComponentInterface, OverlayInterface {
127117
}
128118
}
129119

130-
componentDidLoad() {
131-
this.ionLoadingDidLoad.emit();
132-
}
133-
134-
componentDidUnload() {
135-
this.ionLoadingDidUnload.emit();
136-
}
137-
138120
@Listen('ionBackdropTap')
139121
protected onBackdropTap() {
140122
this.dismiss(undefined, BACKDROP);

0 commit comments

Comments
 (0)