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(mat-tab-group): mat-tab-header-pagination buttons are not reacting to viewport resize #22399

Closed
Romjkez opened this issue Apr 5, 2021 · 2 comments · Fixed by #22442
Closed
Assignees
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Romjkez
Copy link

Romjkez commented Apr 5, 2021

Overview

In Angular Material v9.2.4 (and earlier) we had the following behavior: if you resize the viewport, mat-tab-group will automatically show/hide mat-tab-header-pagination buttons (buttons used for scrolling mat-tab-group horizontally) depending on how much space is available for tabs.
Starting from v10 this behavior changed.

Reproduction

Use StackBlitz to reproduce your issue:

Steps to reproduce:

  1. Reduce width of viewport (resize) to make only some of the tabs visible
  2. Click on any (not disabled) tab
  3. Increase width of viewport (resize) to make all of the tabs visible
  4. Click on any (not disabled) tab or pagination button

Expected Behavior

mat-tab-header-pagination buttons should immediately appear/disappear as soon as mat-tab-group shrank/expanded
OR (for change detection optimizations)
mat-tab-header-pagination buttons should appear after user finished resizing, but with some delay (50-200ms for example)

Actual Behavior

mat-tab-header-pagination buttons visibility change only after manual triggering of change detection (programmatically or by user action - click)

Environment

  • Angular: 11.2.8
  • CDK/Material: 11.2.6
  • Browser(s): Version: Chrome 89.0.4389.114 (Official Build) (64-bit)
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows
@Romjkez Romjkez added the needs triage This issue needs to be triaged by the team label Apr 5, 2021
@Romjkez Romjkez changed the title bug(mat-tab-group): mat-tab-header-pagination is not reacting to viewport resize bug(mat-tab-group): mat-tab-header-pagination buttons are not reacting to viewport resize Apr 5, 2021
@Romjkez
Copy link
Author

Romjkez commented Apr 5, 2021

I think it could be also related to #22384

@crisbeto crisbeto added area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent and removed needs triage This issue needs to be triaged by the team labels Apr 6, 2021
@crisbeto crisbeto self-assigned this Apr 9, 2021
@crisbeto crisbeto added the has pr label Apr 9, 2021
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 9, 2021
The tab header pagination wasn't updating when the page is resized, because the resize listener runs outside of Angular.

Fixes angular#22399.
mmalerba pushed a commit that referenced this issue Apr 13, 2021
The tab header pagination wasn't updating when the page is resized, because the resize listener runs outside of Angular.

Fixes #22399.
mmalerba pushed a commit that referenced this issue Apr 13, 2021
The tab header pagination wasn't updating when the page is resized, because the resize listener runs outside of Angular.

Fixes #22399.

(cherry picked from commit 30ea79a)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/tabs P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants