diff --git a/src/@fuse/components/drawer/drawer.component.scss b/src/@fuse/components/drawer/drawer.component.scss index 79a2938f..2016b2d4 100644 --- a/src/@fuse/components/drawer/drawer.component.scss +++ b/src/@fuse/components/drawer/drawer.component.scss @@ -116,7 +116,7 @@ fuse-drawer { left: 0; right: 0; z-index: 299; - opacity: 0; + opacity: 1; background-color: rgba(0, 0, 0, 0.6); /* Fixed mode */ diff --git a/src/@fuse/components/drawer/drawer.component.ts b/src/@fuse/components/drawer/drawer.component.ts index 7b38e0a7..d644c14b 100644 --- a/src/@fuse/components/drawer/drawer.component.ts +++ b/src/@fuse/components/drawer/drawer.component.ts @@ -211,6 +211,12 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy */ ngOnDestroy(): void { + // Finish the animation + if ( this._player ) + { + this._player.finish(); + } + // Deregister the drawer from the registry this._fuseDrawerService.deregisterComponent(this.name); } @@ -338,6 +344,7 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy // Create the enter animation and attach it to the player this._player = this._animationBuilder.build([ + style({opacity: 0}), animate('300ms cubic-bezier(0.25, 0.8, 0.25, 1)', style({opacity: 1})) ]).create(this._overlay); @@ -346,6 +353,7 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy // Destroy the player this._player.destroy(); + this._player = null; }); // Play the animation @@ -382,6 +390,7 @@ export class FuseDrawerComponent implements OnChanges, OnInit, OnDestroy // Destroy the player this._player.destroy(); + this._player = null; // If the backdrop still exists... if ( this._overlay )