Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmetcetin01140 committed Jun 27, 2024
1 parent b6422b3 commit ecea54b
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,20 +257,9 @@ export class AccordionTab implements AfterContentInit, OnDestroy {
});
}

isElementInList(target: HTMLElement | null, elementList: string[]): boolean {
if (!target) {
return false;
}

const tagName = target.tagName.toLowerCase();
return elementList.includes(tagName);
}

toggle(event?: MouseEvent | KeyboardEvent) {
const target = event.target as HTMLElement;
const elements = ['a', 'button', 'input', 'textarea'];

if (this.disabled || (this.isElementInList(target, elements) && !target.classList.contains('p-accordion-header-link'))) {
if (this.disabled) {
return false;
}

Expand Down Expand Up @@ -322,6 +311,7 @@ export class AccordionTab implements AfterContentInit, OnDestroy {
case 'Enter':
case 'Space':
this.toggle(event);
event.preventDefault();
break;
default:
break;
Expand Down

0 comments on commit ecea54b

Please sign in to comment.