Skip to content

Commit

Permalink
improve focus (#3537)
Browse files Browse the repository at this point in the history
  • Loading branch information
emeryro authored Aug 1, 2024
1 parent f625f5d commit 2bf57d3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/implementations/vanilla/components/timeline/timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ export class Timeline {
this.button.focus();
} else {
this.element.setAttribute('data-ecl-timeline-expanded', 'true');

// Focus first expanded item
const item = queryOne('.ecl-timeline__item--collapsed', this.element);
if (item) {
item.setAttribute('tabindex', '-1');
item.focus({ focusVisible: false });
item.removeAttribute('tabindex');
}
}

// Toggle label if possible
Expand Down

1 comment on commit 2bf57d3

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.