Skip to content

Commit 506bca5

Browse files
authored
feat(material/tabs): add stretchTabs to MatTabsConfig (#26644)
* feat: add `stretchTabs` to `MatTabsConfig` * Update tab-group.ts * change default to `true` as per @crisbeto 's request * yarn ng-dev format files src/material/tabs/tab-config.ts src/material/tabs/tab-group.ts * feat(material/tabs): update api guard
1 parent 8f29413 commit 506bca5

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/material/tabs/tab-config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ export interface MatTabsConfig {
3636
* like iframes and videos from reloading next time it comes back into the view.
3737
*/
3838
preserveContent?: boolean;
39+
40+
/** Whether tabs should be stretched to fill the header. */
41+
stretchTabs?: boolean;
3942
}
4043

4144
/** Injection token that can be used to provide the default options the tabs module. */

src/material/tabs/tab-group.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,8 @@ export class MatTabGroup extends _MatTabGroupBase {
566566
defaultConfig && defaultConfig.fitInkBarToContent != null
567567
? defaultConfig.fitInkBarToContent
568568
: false;
569+
this.stretchTabs =
570+
defaultConfig && defaultConfig.stretchTabs != null ? defaultConfig.stretchTabs : true;
569571
}
570572
}
571573

tools/public_api_guard/material/tabs.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,7 @@ export interface MatTabsConfig {
568568
dynamicHeight?: boolean;
569569
fitInkBarToContent?: boolean;
570570
preserveContent?: boolean;
571+
stretchTabs?: boolean;
571572
}
572573

573574
// @public (undocumented)

0 commit comments

Comments
 (0)