Skip to content

Commit

Permalink
Also remove activedescendant attribute from previously active element…
Browse files Browse the repository at this point in the history
… in case it's no longer in the DOM
  • Loading branch information
camertron committed Oct 21, 2024
1 parent 62dc90a commit ee1e19d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/focus-zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ export function focusZone(container: HTMLElement, settings?: FocusZoneSettings):

activeDescendantControl?.removeAttribute('aria-activedescendant')
container.removeAttribute(hasActiveDescendantAttribute)
previouslyActiveElement?.removeAttribute(isActiveDescendantAttribute)

for (const item of container.querySelectorAll(`[${isActiveDescendantAttribute}]`)) {
item?.removeAttribute(isActiveDescendantAttribute)
Expand Down

0 comments on commit ee1e19d

Please sign in to comment.