From c31bcde720ec76f8963d73dd55e103ba57ed0614 Mon Sep 17 00:00:00 2001 From: "Manu Mtz.-Almeida" Date: Tue, 27 Mar 2018 23:07:56 +0200 Subject: [PATCH] fix(menu): default menu mode --- core/src/components/menu/menu.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/components/menu/menu.tsx b/core/src/components/menu/menu.tsx index 8950739a13..c564feae4d 100644 --- a/core/src/components/menu/menu.tsx +++ b/core/src/components/menu/menu.tsx @@ -52,7 +52,7 @@ export class Menu { * see the `menuType` in the [config](../../config/Config). Available options: * `"overlay"`, `"reveal"`, `"push"`. */ - @Prop({ mutable: true }) type = 'overlay'; + @Prop({ mutable: true }) type: string; @Watch('type') typeChanged(type: string, oldType: string | null) { @@ -122,6 +122,9 @@ export class Menu { async componentWillLoad() { this.menuCtrl = await this.lazyMenuCtrl.componentOnReady(); + if (this.type == null) { + this.type = this.mode === 'ios' ? 'reveal' : 'overlay'; + } } componentDidLoad() { @@ -232,7 +235,7 @@ export class Menu { // Menu swipe animation takes the menu's inner width as parameter, // If `offsetWidth` changes, we need to create a new animation. const width = this.menuInnerEl.offsetWidth; - if (width === this.width && this.animation !== null) { + if (width === this.width && this.animation !== undefined) { return; } this.width = width; @@ -240,7 +243,7 @@ export class Menu { // Destroy existing animation if (this.animation) { this.animation.destroy(); - this.animation = null; + this.animation = undefined; } // Create new animation this.animation = await this.menuCtrl.createAnimation(this.type, this);