diff --git a/src/app/components/accordion/accordion.ts b/src/app/components/accordion/accordion.ts index 447dbf88104..391e1cff553 100755 --- a/src/app/components/accordion/accordion.ts +++ b/src/app/components/accordion/accordion.ts @@ -230,11 +230,7 @@ export class AccordionTab implements AfterContentInit, OnDestroy { accordion: Accordion; - constructor( - @Inject(forwardRef(() => Accordion)) accordion: Accordion, - public el: ElementRef, - public changeDetector: ChangeDetectorRef - ) { + constructor(@Inject(forwardRef(() => Accordion)) accordion: Accordion, public el: ElementRef, public changeDetector: ChangeDetectorRef) { this.accordion = accordion as Accordion; this.id = UniqueComponentId(); } @@ -262,9 +258,8 @@ export class AccordionTab implements AfterContentInit, OnDestroy { } toggle(event?: MouseEvent | KeyboardEvent) { - const target = event.target as HTMLElement; - if (this.disabled || !(target.tagName.toLowerCase() === 'a' && target.classList.contains('p-accordion-header-link'))) { + if (this.disabled) { return false; } @@ -443,10 +438,7 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { public tabs: AccordionTab[] = []; - constructor( - public el: ElementRef, - public changeDetector: ChangeDetectorRef - ) {} + constructor(public el: ElementRef, public changeDetector: ChangeDetectorRef) {} @HostListener('keydown', ['$event']) onKeydown(event) { @@ -646,3 +638,4 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { declarations: [Accordion, AccordionTab] }) export class AccordionModule {} +