Skip to content

Commit 9fd36aa

Browse files
author
Nikki Massaro Kauffman
committed
fix(accordion): fixed issue where accordion set active roving tabindex item incorrectly
1 parent c7fa944 commit 9fd36aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

elements/pf-accordion/BaseAccordion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export abstract class BaseAccordion extends LitElement {
9797
get #activeHeader() {
9898
const { headers } = this;
9999
const index = headers.findIndex(header => header.matches(':focus,:focus-within'));
100-
return headers.at(index);
100+
return index > -1 ? headers.at(index) : undefined;
101101
}
102102

103103
protected expandedSets = new Set<number>();
@@ -162,7 +162,7 @@ export abstract class BaseAccordion extends LitElement {
162162
this.updateAccessibility();
163163
}
164164

165-
#updateActiveHeader() {
165+
#updateActiveHeader(event: FocusEvent) {
166166
if (this.#activeHeader) {
167167
this.#headerIndex.updateActiveItem(this.#activeHeader);
168168
}

0 commit comments

Comments
 (0)