File tree Expand file tree Collapse file tree 4 files changed +32
-7
lines changed
components-examples/material/tabs/tab-group-preserve-content
tools/public_api_guard/material Expand file tree Collapse file tree 4 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 11< p > Start the video in the first tab and navigate to the second one to see how it keeps playing.</ p >
22
3- < mat-tab-group [ preserveContent] =" true " >
3+ < mat-tab-group preserveContent >
44 < mat-tab label ="First ">
55 < iframe
66 width ="560 "
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ import {
2222 Input ,
2323} from '@angular/core' ;
2424import { Direction , Directionality } from '@angular/cdk/bidi' ;
25- import { coerceNumberProperty , NumberInput } from '@angular/cdk/coercion' ;
25+ import {
26+ BooleanInput ,
27+ coerceBooleanProperty ,
28+ coerceNumberProperty ,
29+ NumberInput ,
30+ } from '@angular/cdk/coercion' ;
2631import { ViewportRuler } from '@angular/cdk/scrolling' ;
2732import { FocusKeyManager , FocusableOption } from '@angular/cdk/a11y' ;
2833import { ENTER , SPACE , hasModifierKey } from '@angular/cdk/keycodes' ;
@@ -121,7 +126,13 @@ export abstract class MatPaginatedTabHeader
121126 * layout recalculations if it's known that pagination won't be required.
122127 */
123128 @Input ( )
124- disablePagination : boolean = false ;
129+ get disablePagination ( ) : boolean {
130+ return this . _disablePagination ;
131+ }
132+ set disablePagination ( value : BooleanInput ) {
133+ this . _disablePagination = coerceBooleanProperty ( value ) ;
134+ }
135+ private _disablePagination : boolean = false ;
125136
126137 /** The index of the active tab. */
127138 get selectedIndex ( ) : number {
Original file line number Diff line number Diff line change @@ -161,15 +161,27 @@ export abstract class _MatTabGroupBase
161161 * layout recalculations if it's known that pagination won't be required.
162162 */
163163 @Input ( )
164- disablePagination : boolean ;
164+ get disablePagination ( ) : boolean {
165+ return this . _disablePagination ;
166+ }
167+ set disablePagination ( value : BooleanInput ) {
168+ this . _disablePagination = coerceBooleanProperty ( value ) ;
169+ }
170+ private _disablePagination : boolean ;
165171
166172 /**
167173 * By default tabs remove their content from the DOM while it's off-screen.
168174 * Setting this to `true` will keep it in the DOM which will prevent elements
169175 * like iframes and videos from reloading next time it comes back into the view.
170176 */
171177 @Input ( )
172- preserveContent : boolean ;
178+ get preserveContent ( ) : boolean {
179+ return this . _preserveContent ;
180+ }
181+ set preserveContent ( value : BooleanInput ) {
182+ this . _preserveContent = coerceBooleanProperty ( value ) ;
183+ }
184+ private _preserveContent : boolean ;
173185
174186 /** Background color of the tab group. */
175187 @Input ( )
Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
233233 protected _changeDetectorRef: ChangeDetectorRef ;
234234 get contentTabIndex(): number | null ;
235235 set contentTabIndex(value : NumberInput );
236- disablePagination: boolean ;
236+ get disablePagination(): boolean ;
237+ set disablePagination(value : BooleanInput );
237238 get dynamicHeight(): boolean ;
238239 set dynamicHeight(value : BooleanInput );
239240 readonly focusChange: EventEmitter <MatTabChangeEvent >;
@@ -250,7 +251,8 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
250251 ngAfterContentInit(): void ;
251252 // (undocumented)
252253 ngOnDestroy(): void ;
253- preserveContent: boolean ;
254+ get preserveContent(): boolean ;
255+ set preserveContent(value : BooleanInput );
254256 realignInkBar(): void ;
255257 _removeTabBodyWrapperHeight(): void ;
256258 get selectedIndex(): number | null ;
You can’t perform that action at this time.
0 commit comments