diff --git a/src/app/components/accordion/accordion.ts b/src/app/components/accordion/accordion.ts index 238e2ab0b61..7b46b274d8e 100755 --- a/src/app/components/accordion/accordion.ts +++ b/src/app/components/accordion/accordion.ts @@ -464,22 +464,12 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { } } - isInput(event): boolean { - const { tagName } = event.target; - return tagName?.toLowerCase() === 'input'; - } - - isTextArea(event): boolean { - const { tagName } = event.target; - return tagName?.toLowerCase() === 'textarea'; - } - focusedElementIsAccordionHeader() { return document.activeElement.tagName.toLowerCase() === 'a' && document.activeElement.classList.contains('p-accordion-header-link'); } onTabArrowDownKey(event) { - if (!this.isInput(event) && !this.isTextArea(event) && this.focusedElementIsAccordionHeader()) { + if (this.focusedElementIsAccordionHeader()) { const nextHeaderAction = this.findNextHeaderAction(event.target.parentElement.parentElement.parentElement); nextHeaderAction ? this.changeFocusedTab(nextHeaderAction) : this.onTabHomeKey(event); @@ -488,7 +478,7 @@ export class Accordion implements BlockableUI, AfterContentInit, OnDestroy { } onTabArrowUpKey(event) { - if (!this.isInput(event) && !this.isTextArea(event) && this.focusedElementIsAccordionHeader()) { + if (this.focusedElementIsAccordionHeader()) { const prevHeaderAction = this.findPrevHeaderAction(event.target.parentElement.parentElement.parentElement); prevHeaderAction ? this.changeFocusedTab(prevHeaderAction) : this.onTabEndKey(event);