PolymerElements / app-layout

App layout elements
https://webcomponents.org/element/PolymerElements/app-layout
597 stars 311 forks source link

Cannot read property 'opened' of undefined #554

Closed ebatgerel closed 6 years ago

ebatgerel commented 6 years ago

Description

When i use the app-layout throws error to console. But it works good before.

Here is my html structure

<app-drawer slot="drawer" swipe-open id="left">
      <section>
         <div id="dashboard" on-click="selectDashboard">Dashboard</div>
         <div id="users" on-click="selectUsers">Users</div>
         <div id="categoryTree"></div>
      </section>
</app-drawer>
onLayoutChange(wide) {
            let drawer = this.$.drawer;
            if (wide && drawer.opened) {
                drawer.opened = false;
            }
        }

capture

Expected outcome

Should work

Actual outcome

Cannot read property 'opened' of undefined

Live Demo

capture

Browsers Affected

keanulee commented 6 years ago

<app-drawer slot="drawer" swipe-open id="left"> means drawer = this.$.left; ($ node finding maps to element id).