Skip to content

Commit

Permalink
fix sidenav opening glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelcobain committed Nov 25, 2016
1 parent c95b2cf commit e923c51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/components/paper-sidenav-inner.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default Component.extend(TransitionMixin, {
isLockedOpen = window.matchMedia(mediaQuery).matches;
}

if (this.get('isLockedOpen') !== isLockedOpen) {
if (!!this.get('isLockedOpen') !== isLockedOpen) {
this.set('isLockedOpen', isLockedOpen);

// if sidenav is open and we enter lockedOpen,
Expand Down

3 comments on commit e923c51

@BennyAlex
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol the first time I see an double exclamation mark

@xomaczar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bang, bang you have a boolean now. @miguelcobain why isLockedOpen not a booleanto begin with - are we just protecting against someone binding not a boolean to it

@miguelcobain
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xomaczar isLockedOpen was undefined at first, making ember-css-transitions trigger a transition because there was a change from undefined to false.
This makes things work properly as a boolean, either on or off.

Please sign in to comment.