Skip to content

Commit

Permalink
fix(material-experimental/mdc-tabs): markForCheck on ink bar content …
Browse files Browse the repository at this point in the history
…input setter (#17561)
  • Loading branch information
andrewseguin authored and jelbourn committed Nov 26, 2019
1 parent ec77513 commit 71165f1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/material-experimental/mdc-tabs/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ export class MatTabGroup extends _MatTabGroupBase {
/** Whether the ink bar should fit its width to the size of the tab label content. */
@Input()
get fitInkBarToContent(): boolean { return this._fitInkBarToContent; }
set fitInkBarToContent(v: boolean) { this._fitInkBarToContent = coerceBooleanProperty(v); }
set fitInkBarToContent(v: boolean) {
this._fitInkBarToContent = coerceBooleanProperty(v);
this._changeDetectorRef.markForCheck();
}
private _fitInkBarToContent = false;

constructor(elementRef: ElementRef,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export class MatTabNav extends _MatTabNavBase implements AfterContentInit {
/** Whether the ink bar should fit its width to the size of the tab label content. */
@Input()
get fitInkBarToContent(): boolean { return this._fitInkBarToContent.value; }
set fitInkBarToContent(v: boolean) { this._fitInkBarToContent.next(coerceBooleanProperty(v)); }
set fitInkBarToContent(v: boolean) {
this._fitInkBarToContent.next(coerceBooleanProperty(v));
this._changeDetectorRef.markForCheck();
}
_fitInkBarToContent = new BehaviorSubject(false);

@ContentChildren(forwardRef(() => MatTabLink), {descendants: true}) _items: QueryList<MatTabLink>;
Expand Down
2 changes: 1 addition & 1 deletion src/material/tabs/tab-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
private _groupId: number;

constructor(elementRef: ElementRef,
private _changeDetectorRef: ChangeDetectorRef,
protected _changeDetectorRef: ChangeDetectorRef,
@Inject(MAT_TABS_CONFIG) @Optional() defaultConfig?: MatTabsConfig,
@Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string) {
super(elementRef);
Expand Down
1 change: 1 addition & 0 deletions tools/public_api_guard/material/tabs.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export declare abstract class _MatTabBodyBase implements OnInit, OnDestroy {
export declare abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements AfterContentInit, AfterContentChecked, OnDestroy, CanColor, CanDisableRipple {
abstract _allTabs: QueryList<MatTab>;
_animationMode?: string | undefined;
protected _changeDetectorRef: ChangeDetectorRef;
abstract _tabBodyWrapper: ElementRef;
abstract _tabHeader: MatTabGroupBaseHeader;
_tabs: QueryList<MatTab>;
Expand Down

0 comments on commit 71165f1

Please sign in to comment.