Skip to content

Commit

Permalink
Merge pull request #15838 from primefaces/issue-15837
Browse files Browse the repository at this point in the history
Fixed #15837 - Accessibility: Buttons within an accordion header temp…
  • Loading branch information
cetincakiroglu authored Jun 13, 2024
2 parents e5f593e + 183321e commit 52e3607
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -262,7 +258,9 @@ export class AccordionTab implements AfterContentInit, OnDestroy {
}

toggle(event?: MouseEvent | KeyboardEvent) {
if (this.disabled) {
const target = event.target as HTMLElement;

if (this.disabled || !(target.tagName.toLowerCase() === 'a' && target.classList.contains('p-accordion-header-link'))) {
return false;
}

Expand Down Expand Up @@ -441,10 +439,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) {
Expand Down

0 comments on commit 52e3607

Please sign in to comment.