angular / angular/components

bug(tab): position sticky is broken inside of tabs

Open
#28,500 2 comments 3 reactions 0 assignees View on GitHub
area: material/tabs P4
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

_No response_

### Description

position sticky doesn't work inside of mat-tabs because they use overflow: hidden;

### Reproduction

StackBlitz link: https://components-issue-kwznw3.stackblitz.io https://stackblitz.com/edit/components-issue-kwznw3?file=src%2Fapp%2Fexample-component.html
Steps to reproduce:
1. scroll down
2. see that the "broken scroll" element inside of the tab doesn't stick, but the same code outside does (see "sticky" right below it)

### Expected Behavior

position sticky should work

### Actual Behavior

position sticky doesn't work

### Environment

- Angular: tried it with 16.2.1 and 17.1.0
- CDK/Material: tried it with 16.2.1 and 17.1.0
- Browser(s): chrome/firefox
- Operating System (e.g. Windows, macOS, Ubuntu): windows

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and the referenced src/app/example-component.html, then inspect how the tab container’s overflow behavior affects position: sticky. The work is done when the element inside a tab sticks while scrolling as shown by the reproduction, without regressing normal tab behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.