angular / angular/components

bug(mat-autocomplete): Autocomplete options are moving with dialog scrollbar

Open
#30,416 10 comments 0 reactions 0 assignees View on GitHub
area: cdk/dialog area: material/autocomplete P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

### 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

See: https://github.com/angular/components/issues/30254, it was present in 18 version.

### Description

Demo: https://github.com/lopatnov/autocomplete-issue

### Reproduction

StackBlitz link: I don't use StackBlitz, don't know how to upload demo here.
Steps to reproduce:
1. Open dialog with some elements, to have scroll in the dialog
2. Open Autocomplete items
3. Scroll down dialog scroll and you will see issue

### Expected Behavior

Options of Autocomplete should stay below autocomplete, as it was opened. They don't need to move with dialog scrollbar.

### Actual Behavior

When dialog scrollbar moves, then autocomplete options also moves.

### Environment

- Angular: 19.1.0
- CDK/Material: 19.1.1
- Browser(s): Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked reproduction at https://github.com/lopatnov/autocomplete-issue and reproduce the issue using the listed dialog, autocomplete, and scrollbar steps. Trace the Angular Material dialog and autocomplete behavior involved in positioning, then verify that scrolling the dialog leaves the options below the autocomplete trigger.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.