Skip to content

Commit ce73a5e

Browse files
committed
fix(collapse): display none hotfix
1 parent f217718 commit ce73a5e

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

projects/coreui-angular/src/lib/collapse/collapse.directive.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {
2-
AfterViewInit,
32
Directive,
43
DoCheck,
54
ElementRef,
@@ -23,7 +22,7 @@ import { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';
2322
selector: '[cCollapse]',
2423
exportAs: 'cCollapse'
2524
})
26-
export class CollapseDirective implements OnChanges, OnDestroy, DoCheck, AfterViewInit {
25+
export class CollapseDirective implements OnChanges, OnDestroy, DoCheck {
2726

2827
static ngAcceptInputType_navbar: BooleanInput;
2928

@@ -97,10 +96,6 @@ export class CollapseDirective implements OnChanges, OnDestroy, DoCheck, AfterVi
9796
};
9897
}
9998

100-
ngAfterViewInit(): void {
101-
this.renderer.removeStyle(this.host, 'display');
102-
}
103-
10499
ngOnDestroy(): void {
105100
this.destroyPlayer();
106101
}
@@ -119,6 +114,9 @@ export class CollapseDirective implements OnChanges, OnDestroy, DoCheck, AfterVi
119114
}
120115

121116
toggle(visible = this.visible): void {
117+
if (visible) {
118+
this.renderer.removeStyle(this.host, 'display');
119+
}
122120
this.visible = visible;
123121
this.createPlayer(visible);
124122
this.player.play();

0 commit comments

Comments
 (0)