mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-10 00:27:41 +08:00
fix(menu): allow ssr to work properly with hardware back button updates (#20629)
This commit is contained in:
@ -207,15 +207,17 @@ const createMenuController = () => {
|
|||||||
registerAnimation('push', menuPushAnimation);
|
registerAnimation('push', menuPushAnimation);
|
||||||
registerAnimation('overlay', menuOverlayAnimation);
|
registerAnimation('overlay', menuOverlayAnimation);
|
||||||
|
|
||||||
const doc: Document = document;
|
/* tslint:disable-next-line */
|
||||||
doc.addEventListener('ionBackButton', (ev: any) => {
|
if (typeof document !== 'undefined') {
|
||||||
const openMenu = _getOpenSync();
|
document.addEventListener('ionBackButton', (ev: any) => {
|
||||||
if (openMenu) {
|
const openMenu = _getOpenSync();
|
||||||
(ev as BackButtonEvent).detail.register(MENU_BACK_BUTTON_PRIORITY, () => {
|
if (openMenu) {
|
||||||
return openMenu.close();
|
(ev as BackButtonEvent).detail.register(MENU_BACK_BUTTON_PRIORITY, () => {
|
||||||
});
|
return openMenu.close();
|
||||||
}
|
});
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
registerAnimation,
|
registerAnimation,
|
||||||
|
|||||||
Reference in New Issue
Block a user