ionic-team / ionic-v1

The repo for Ionic 1.x. For the latest version of Ionic, please see https://github.com/ionic-team/ionic
Other
193 stars 187 forks source link

bug: Sidebar with expose-aside-when doesn't show if width is defined with variable #142

Open jgw96 opened 7 years ago

jgw96 commented 7 years ago

From @axsauze on April 17, 2016 13:50

There is a bug for the ion-side-menu when you have expose-aside-when. If a width is provided using a scope variable, the sidebar won't display.

Steps to reproduce:

  1. Create a sidebar (i.e. ion-side-menus)
  2. In the ion-side-menu directive, add expose-aside-when="large" and width="scopeVar"
  3. Load the page with large screen and observe how sidemenu does not appear

Code example:

<ion-side-menu 
            side="left" 
            expose-aside-when="large">
            <!-- width="$ctrl.getSidebarWidth()" -->
        <ion-header-bar>
            <div class="title title-center header-item">Navigation</div>
        </ion-header-bar>
        <ion-content>
            <ion-list>
                <ion-item nav-clear menu-close ui-sref="home">
                    Home
                </ion-item>
            </ion-list>
        </ion-content>
    </ion-side-menu>

Which Ionic Version? 1.x

Quickfix As a quickfix I've added "ionic.trigger('resize');" inside the function that returns the width (i.e. $ctrl.getSidebarWidth(); )

Copied from original issue: driftyco/ionic#6204

jgw96 commented 7 years ago

From @axsauze on April 17, 2016 14:37

As a quickfix I've added "ionic.trigger('resize');" inside the function that returns the width (i.e. $ctrl.getSidebarWidth(); )