mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-20 12:29:55 +08:00
docs(overlay): onDidDismiss() and onWillDismiss()
This commit is contained in:
28
core/src/components.d.ts
vendored
28
core/src/components.d.ts
vendored
@ -126,11 +126,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the action-sheet did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the action-sheet will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -285,11 +285,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the alert did dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the alert did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the alert will dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the alert will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -2291,11 +2291,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the loading did dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the loading did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the loading will dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the loading will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -2642,11 +2642,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the modal did dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the modal did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the modal will dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the modal will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -2963,11 +2963,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the picker did dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the picker did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the picker will dismiss. It also accepts a callback that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the picker will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -3115,11 +3115,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the popover did dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the popover did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the popover will dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the popover will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
@ -4930,11 +4930,11 @@ export namespace Components {
|
||||
*/
|
||||
'mode': Mode;
|
||||
/**
|
||||
* Returns a promise that resolves when the toast did dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the toast did dismiss.
|
||||
*/
|
||||
'onDidDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
/**
|
||||
* Returns a promise that resolves when the toast will dismiss. It also accepts a callback that is called in the same circustances.
|
||||
* Returns a promise that resolves when the toast will dismiss.
|
||||
*/
|
||||
'onWillDismiss': () => Promise<OverlayEventDetail<any>>;
|
||||
'overlayIndex': number;
|
||||
|
@ -125,7 +125,7 @@ export class ActionSheet implements OverlayInterface {
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
return this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
|
||||
@Listen('ionActionSheetWillDismiss')
|
||||
@ -154,9 +154,7 @@ export class ActionSheet implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback
|
||||
* that is called in the same circustances.
|
||||
*
|
||||
* Returns a promise that resolves when the action-sheet did dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onDidDismiss(): Promise<OverlayEventDetail> {
|
||||
@ -164,8 +162,7 @@ export class ActionSheet implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback
|
||||
* that is called in the same circustances.
|
||||
* Returns a promise that resolves when the action-sheet will dismiss.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
|
@ -46,12 +46,12 @@ A button's `role` property can either be `destructive` or `cancel`. Buttons with
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the action sheet overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the action-sheet did dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the action-sheet will dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `present` | Present the action sheet overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | ------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the action sheet overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the action-sheet did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the action-sheet will dismiss. |
|
||||
| `present` | Present the action sheet overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -181,7 +181,7 @@ export class Alert implements OverlayInterface {
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
return this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
|
||||
@Listen('ionAlertWillDismiss')
|
||||
@ -210,8 +210,7 @@ export class Alert implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the alert did dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the alert did dismiss.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
@ -220,8 +219,7 @@ export class Alert implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the alert will dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the alert will dismiss.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
|
@ -57,12 +57,12 @@ Alerts can also include several different inputs whose data can be passed back t
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the alert overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the alert did dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the alert will dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `present` | Present the alert overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | ------------------------------------------------------------ |
|
||||
| `dismiss` | Dismiss the alert overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the alert did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the alert will dismiss. |
|
||||
| `present` | Present the alert overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -137,7 +137,7 @@ export class Loading implements OverlayInterface {
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
return this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -167,8 +167,7 @@ export class Loading implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the loading did dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the loading did dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onDidDismiss(): Promise<OverlayEventDetail> {
|
||||
@ -176,8 +175,7 @@ export class Loading implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the loading will dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the loading will dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onWillDismiss(): Promise<OverlayEventDetail> {
|
||||
|
@ -49,12 +49,12 @@ The loading indicator can be dismissed automatically after a specific amount of
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the loading overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the loading did dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the loading will dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `present` | Present the loading overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | -------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the loading overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the loading did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the loading will dismiss. |
|
||||
| `present` | Present the loading overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -132,7 +132,7 @@ export class Modal implements OverlayInterface {
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
return this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
|
||||
@Listen('ionModalDidPresent')
|
||||
@ -186,8 +186,7 @@ export class Modal implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the modal did dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the modal did dismiss.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
@ -196,8 +195,7 @@ export class Modal implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the modal will dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
* Returns a promise that resolves when the modal will dismiss.
|
||||
*
|
||||
*/
|
||||
@Method()
|
||||
|
@ -44,12 +44,12 @@ Modals can be created using a [Modal Controller](../../modal-controller/ModalCon
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the modal overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the modal did dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `present` | Present the modal overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | ------------------------------------------------------------ |
|
||||
| `dismiss` | Dismiss the modal overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the modal did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the modal will dismiss. |
|
||||
| `present` | Present the modal overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -170,9 +170,7 @@ export class Picker implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the picker did dismiss. It also accepts a callback
|
||||
* that is called in the same circustances.
|
||||
*
|
||||
* Returns a promise that resolves when the picker did dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onDidDismiss(): Promise<OverlayEventDetail> {
|
||||
@ -180,9 +178,7 @@ export class Picker implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the picker will dismiss. It also accepts a callback
|
||||
* that is called in the same circumstances.
|
||||
*
|
||||
* Returns a promise that resolves when the picker will dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onWillDismiss(): Promise<OverlayEventDetail> {
|
||||
|
@ -39,13 +39,13 @@ A Picker is a dialog that displays a row of buttons and columns underneath. It a
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the picker overlay after it has been presented. |
|
||||
| `getColumn` | Returns the column the matches the specified name |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the picker did dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the picker will dismiss. It also accepts a callback that is called in the same circumstances. |
|
||||
| `present` | Present the picker overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | ------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the picker overlay after it has been presented. |
|
||||
| `getColumn` | Returns the column the matches the specified name |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the picker did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the picker will dismiss. |
|
||||
| `present` | Present the picker overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -142,7 +142,7 @@ export class Popover implements OverlayInterface {
|
||||
|
||||
@Listen('ionBackdropTap')
|
||||
protected onBackdropTap() {
|
||||
return this.dismiss(null, BACKDROP);
|
||||
return this.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
|
||||
@Listen('ionPopoverDidPresent')
|
||||
@ -196,9 +196,7 @@ export class Popover implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the popover did dismiss. It also accepts a callback
|
||||
* that is called in the same circustances.
|
||||
*
|
||||
* Returns a promise that resolves when the popover did dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onDidDismiss(): Promise<OverlayEventDetail> {
|
||||
@ -206,9 +204,7 @@ export class Popover implements OverlayInterface {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a promise that resolves when the popover will dismiss. It also accepts a callback
|
||||
* that is called in the same circustances.
|
||||
*
|
||||
* Returns a promise that resolves when the popover will dismiss.
|
||||
*/
|
||||
@Method()
|
||||
onWillDismiss(): Promise<OverlayEventDetail> {
|
||||
|
@ -48,12 +48,12 @@ To present a popover, call the `present` method on a popover instance. In order
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the popover overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the popover did dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the popover will dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `present` | Present the popover overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | -------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the popover overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the popover did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the popover will dismiss. |
|
||||
| `present` | Present the popover overlay after it has been created. |
|
||||
|
||||
|
||||
----------------------------------------------
|
||||
|
@ -51,12 +51,12 @@ The toast can be dismissed automatically after a specific amount of time by pass
|
||||
|
||||
## Methods
|
||||
|
||||
| Method | Description |
|
||||
| --------------- | -------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `dismiss` | Dismiss the toast overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the toast did dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the toast will dismiss. It also accepts a callback that is called in the same circustances. |
|
||||
| `present` | Present the toast overlay after it has been created. |
|
||||
| Method | Description |
|
||||
| --------------- | ------------------------------------------------------------ |
|
||||
| `dismiss` | Dismiss the toast overlay after it has been presented. |
|
||||
| `onDidDismiss` | Returns a promise that resolves when the toast did dismiss. |
|
||||
| `onWillDismiss` | Returns a promise that resolves when the toast will dismiss. |
|
||||
| `present` | Present the toast overlay after it has been created. |
|
||||
|
||||
|
||||
## CSS Custom Properties
|
||||
|
@ -36,7 +36,7 @@ export function createOverlay<T extends HTMLIonOverlayElement>(element: T, opts:
|
||||
function closeTopOverlay(doc: Document) {
|
||||
const lastOverlay = getOverlay(doc);
|
||||
if (lastOverlay && lastOverlay.backdropDismiss) {
|
||||
return lastOverlay.dismiss(null, BACKDROP);
|
||||
return lastOverlay.dismiss(undefined, BACKDROP);
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
Reference in New Issue
Block a user