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,8 +207,9 @@ const createMenuController = () => {
|
||||
registerAnimation('push', menuPushAnimation);
|
||||
registerAnimation('overlay', menuOverlayAnimation);
|
||||
|
||||
const doc: Document = document;
|
||||
doc.addEventListener('ionBackButton', (ev: any) => {
|
||||
/* tslint:disable-next-line */
|
||||
if (typeof document !== 'undefined') {
|
||||
document.addEventListener('ionBackButton', (ev: any) => {
|
||||
const openMenu = _getOpenSync();
|
||||
if (openMenu) {
|
||||
(ev as BackButtonEvent).detail.register(MENU_BACK_BUTTON_PRIORITY, () => {
|
||||
@ -216,6 +217,7 @@ const createMenuController = () => {
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
registerAnimation,
|
||||
|
||||
Reference in New Issue
Block a user