Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(cdkListbox): active item is not scrolled into viewport when useActiveDescendant is true #28989

Open
1 task
alirezamirian opened this issue May 2, 2024 · 0 comments
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

Comments

@alirezamirian
Copy link

Is this a regression?

  • Yes, this behavior used to work in the previous version

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:

  1. Focus the listbox, e.g. by clicking on one of the items
  2. start navigating with arrow keys. The active item goes out of the view

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

@alirezamirian alirezamirian added the needs triage This issue needs to be triaged by the team label May 2, 2024
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: cdk/a11y area: cdk/listbox and removed needs triage This issue needs to be triaged by the team labels May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants