Skip to content

Commit

Permalink
Merge pull request #14455 from bhishman-desai/issue-14392
Browse files Browse the repository at this point in the history
Fixed #14368 - Accordian : TextArea shortcuts are not working when us…
  • Loading branch information
cetincakiroglu authored Jan 10, 2024
2 parents 3bd1c8a + 86bd034 commit fc21b93
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions src/app/components/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,18 +462,32 @@ 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';
}

onTabArrowDownKey(event) {
const nextHeaderAction = this.findNextHeaderAction(event.target.parentElement.parentElement.parentElement);
nextHeaderAction ? this.changeFocusedTab(nextHeaderAction) : this.onTabHomeKey(event);
if (!this.isInput(event) && !this.isTextArea(event)) {
const nextHeaderAction = this.findNextHeaderAction(event.target.parentElement.parentElement.parentElement);
nextHeaderAction ? this.changeFocusedTab(nextHeaderAction) : this.onTabHomeKey(event);

event.preventDefault();
event.preventDefault();
}
}

onTabArrowUpKey(event) {
const prevHeaderAction = this.findPrevHeaderAction(event.target.parentElement.parentElement.parentElement);
prevHeaderAction ? this.changeFocusedTab(prevHeaderAction) : this.onTabEndKey(event);
if (!this.isInput(event) && !this.isTextArea(event)) {
const prevHeaderAction = this.findPrevHeaderAction(event.target.parentElement.parentElement.parentElement);
prevHeaderAction ? this.changeFocusedTab(prevHeaderAction) : this.onTabEndKey(event);

event.preventDefault();
event.preventDefault();
}
}

onTabHomeKey(event) {
Expand Down

0 comments on commit fc21b93

Please sign in to comment.