mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-15 09:34:19 +08:00
feat(menu): pass role to ionWillClose and ionDidClose events (#29954)
- Adds the `MenuCloseEventDetail` interface which includes an optional `role` property - The `ionWillClose` and `ionDidClose` emit the `role` property for the following scenarios: - A role of `'gesture'` when dragging the menu closed - A role of `'backdrop'` when clicking on the backdrop to close the menu - A role of `'backdrop'` when the the menu is closed using the escape key - A role of `undefined` when the menu is closed from a button inside of the menu
This commit is contained in:

committed by
Tanner Reits

parent
2d6eeee267
commit
ee2fa19a1e
@ -1334,6 +1334,8 @@ export class IonMenu {
|
||||
}
|
||||
|
||||
|
||||
import type { MenuCloseEventDetail as IIonMenuMenuCloseEventDetail } from '@ionic/core';
|
||||
|
||||
export declare interface IonMenu extends Components.IonMenu {
|
||||
/**
|
||||
* Emitted when the menu is about to be opened.
|
||||
@ -1342,7 +1344,7 @@ export declare interface IonMenu extends Components.IonMenu {
|
||||
/**
|
||||
* Emitted when the menu is about to be closed.
|
||||
*/
|
||||
ionWillClose: EventEmitter<CustomEvent<void>>;
|
||||
ionWillClose: EventEmitter<CustomEvent<IIonMenuMenuCloseEventDetail>>;
|
||||
/**
|
||||
* Emitted when the menu is open.
|
||||
*/
|
||||
@ -1350,7 +1352,7 @@ export declare interface IonMenu extends Components.IonMenu {
|
||||
/**
|
||||
* Emitted when the menu is closed.
|
||||
*/
|
||||
ionDidClose: EventEmitter<CustomEvent<void>>;
|
||||
ionDidClose: EventEmitter<CustomEvent<IIonMenuMenuCloseEventDetail>>;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user