Skip to content

bug(mat-tab-nav-bar): mat-tab-nav-bar does not use "stretchTabs" from the MAT_TABS_CONFIG #27211

@Klaster1

Description

@Klaster1

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

The tabs docs state that MAT_TABS_CONFIG "can be used to configure the default options for the tabs module". After providing a config with stretchTabs: false, the component does not disable stretching. Disabling stretching through a binding works. Source inspection indicates that mat-tab-nav-bar does not use MAT_TABS_CONFIG for stretchTabs at all, unlike the tab-group.

Reproduction

StackBlitz link: https://stackblitz.com/edit/749enw?file=src%2Fexample%2Ftab-nav-bar-basic-example.ts
Steps to reproduce:
Add the provider:

{
provide: MAT_TABS_CONFIG,
useValue: { stretchTabs: false },
}

Expected Behavior

The stretchTabs from the provided config is applied

Actual Behavior

The stretchTabs from the provided config is not applied

Environment

  • Angular: 16.0.3
  • CDK/Material: 16.0.2
  • Browser(s): Chrome 113
  • Operating System (e.g. Windows, macOS, Ubuntu): Windows 11

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: material/tabs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions