Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
fix(drawer): Fixes an issue with inital rendering when open was not b…
Browse files Browse the repository at this point in the history
…ound.
  • Loading branch information
tomheller committed Nov 26, 2020
1 parent cab023f commit 7f25e11
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion libs/barista-components/drawer/src/drawer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,14 @@ export class DtDrawer implements OnInit, AfterContentChecked, OnDestroy {
// it's width to the original size to prevent relayout
// If the drawer would change size during this process,
// a drift would appear like in APM-266068
if (this._opened === false) {
// ---
// The this._width !== 0 check is necessary, because if the opened
// value on the drawer is set via `opened="false"` (meaning without a binding)
// this will be evaluated only once, which means there was no render
// cycle that could have determined the correct width of the drawer.
// As the drawer would be hidden anyway with a width of 0 we do not need
// to set a closed widht.
if (this._opened === false && this._width !== 0) {
this._closedWidth = this._width;
} else {
this._closedWidth = null;
Expand Down

0 comments on commit 7f25e11

Please sign in to comment.