[ADF-3354] accordion-group closed behaviour (#3595)

* accordion-group closed fix

* tests fixes

* tests added

* tests fixes

* Fix failing unit test and revert deleted method
This commit is contained in:
bbcodrin
2018-07-23 11:24:37 +03:00
committed by Eugenio Romano
parent 0274088114
commit 66f534b32c
3 changed files with 116 additions and 10 deletions

View File

@@ -78,19 +78,19 @@ export class AccordionGroupComponent implements AfterViewInit {
constructor() { }
ngAfterViewInit() {
this.hasContent = this.contentWrapper.nativeElement && this.contentWrapper.nativeElement.children.length > 0;
this.hasContent = this.contentWrapper ? this.contentWrapper.nativeElement && this.contentWrapper.nativeElement.children.length > 0 : false;
}
hasHeadingIcon() {
return this.headingIcon ? true : false;
return !!this.headingIcon;
}
onHeaderClick(): void {
this.headingClick.emit(this.heading);
}
isExpandable(event: any) {
if (!this.hasContent || !this.isOpen) {
isExpandable() {
if (this.hasContent && this.isSelected) {
this.expandPanel();
}
}