Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/cdk/listbox/listbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,13 @@ export class CdkOption<T = unknown> implements ListKeyManagerOption, Highlightab
* No-op implemented as a part of `Highlightable`.
* @docs-private
*/
setActiveStyles() {}
setActiveStyles() {
// If the listbox is using `aria-activedescendant` the option won't have focus so the
// browser won't scroll them into view automatically so we need to do it ourselves.
if (this.listbox.useActiveDescendant) {
this.element.scrollIntoView({block: 'nearest', inline: 'nearest'});
}
}

/**
* No-op implemented as a part of `Highlightable`.
Expand Down