angular / angular/components

MatPaginatedTabHeader doesn't scroll last tab fully into view

Open
#17,853 6 comments 3 reactions 0 assignees View on GitHub
area: material/tabs P3
Dominant language
TypeScript
Stars
25k
Forks
6.8k
Avg merge
1d 8h
Merged PRs (30d)
91

Description

#### Reproduction

Use StackBlitz to reproduce your issue: https://stackblitz.com/edit/components-issue-wsbxpk

Steps to reproduce:
1. Set selectedIndex to last tab
2. Render

#### Expected Behavior
![image](https://user-images.githubusercontent.com/44192365/69958526-4c755880-1505-11ea-9f3f-94b33d5e5541.png)

Selected tab is scrolled fully into view and righthand pagination button disabled just as if the user manually clicked on the last tab

#### Actual Behavior
![image](https://user-images.githubusercontent.com/44192365/69957955-0ff52d00-1504-11ea-8ddb-c6338163bbea.png)

Tab is only partially visible and pagination button remains enabled. When tab titles vary in size only a few pixels of the last tab are visible. Clicking on the last tab manually scrolls it fully into view.

#### Environment

- Angular: 8.2.14
- CDK/Material: 8.2.3
- Browser(s): Chrome, Firefox, Internet Explorer 11, Safari
- Operating System (e.g. Windows, macOS, Ubuntu): All

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction and the MatPaginatedTabHeader implementation, setting selectedIndex to the last tab. Compare initial rendering with manually selecting the last tab, then verify that the selected tab is fully visible and the right pagination button is disabled.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.