bug(cdkListbox): active item is not scrolled into viewport when useActiveDescendant
is true
#28989
Labels
area: cdk/a11y
area: cdk/listbox
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
No response
Description
When
useActiveDescendant
is true, the active option won't stay in the view, if the listbox is scrollable. It can happen both when an option is selected initially, and when the user uses arrow keys to navigate the options.It should be related to the fact that in active descendant mode, listbox option elements won't be focused physically, so they are not automatically scrolled into view.
Reproduction
StackBlitz link: https://stackblitz.com/edit/q47nzr?file=src%2Fexample%2Fcdk-listbox-activedescendant-example.ts
Steps to reproduce:
Expected Behavior
Listbox should scroll to keep the active option within the view, regardless of the value of
useActiveDescendant
.Actual Behavior
Listbox doesn't scroll to keep the active option within the view, when
useActiveDescendant
is true.Environment
@angular-devkit/architect 0.1703.0
@angular-devkit/build-angular 17.3.0
@angular-devkit/core 17.3.0
@angular-devkit/schematics 17.3.0
@angular/cdk 17.3.6
@angular/material 17.3.6
@angular/material-experimental 17.3.6
@angular/material-moment-adapter 17.3.6
@schematics/angular 17.3.0
rxjs 7.4.0
typescript 5.4.2
zone.js 0.14.0
The text was updated successfully, but these errors were encountered: