arkon / ng-sidebar

[Inactive] Angular sidebar component.
https://echeung.me/ng-sidebar
MIT License
388 stars 136 forks source link

Sidebar doesn't animate unless `opened` property is bound. #180

Open Senneseph opened 5 years ago

Senneseph commented 5 years ago

I was going crazy trying to figure out why my sidebar was simply popping into existence instead of smoothly sliding open like in the demo.

So I made a stackblitz to figure out what I was doing wrong: https://stackblitz.com/edit/angular-hbfacn

The only difference between the top and bottom sections is [(opened)]="_opened" on \<ng-sidebar>.

This wasn't mentioned in the docs so I assume it is a bug.

arkon commented 5 years ago

This is due to a workaround for the sidebar being visible on initial load, which basically turns off animate on load and re-enables it once it's triggered to be opened/closed again.

I've yet to think of a good fix for this.


https://github.com/arkon/ng-sidebar/blob/23e651ca10cf9ea446a0ee9e60ae6d8bf523d281/src/sidebar.component.ts#L139