File tree 4 files changed +32
-7
lines changed
components-examples/material/tabs/tab-group-preserve-content
tools/public_api_guard/material
4 files changed +32
-7
lines changed Original file line number Diff line number Diff line change 1
1
< p > Start the video in the first tab and navigate to the second one to see how it keeps playing.</ p >
2
2
3
- < mat-tab-group [ preserveContent] =" true " >
3
+ < mat-tab-group preserveContent >
4
4
< mat-tab label ="First ">
5
5
< iframe
6
6
width ="560 "
Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ import {
22
22
Input ,
23
23
} from '@angular/core' ;
24
24
import { 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' ;
26
31
import { ViewportRuler } from '@angular/cdk/scrolling' ;
27
32
import { FocusKeyManager , FocusableOption } from '@angular/cdk/a11y' ;
28
33
import { ENTER , SPACE , hasModifierKey } from '@angular/cdk/keycodes' ;
@@ -121,7 +126,13 @@ export abstract class MatPaginatedTabHeader
121
126
* layout recalculations if it's known that pagination won't be required.
122
127
*/
123
128
@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 ;
125
136
126
137
/** The index of the active tab. */
127
138
get selectedIndex ( ) : number {
Original file line number Diff line number Diff line change @@ -161,15 +161,27 @@ export abstract class _MatTabGroupBase
161
161
* layout recalculations if it's known that pagination won't be required.
162
162
*/
163
163
@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 ;
165
171
166
172
/**
167
173
* By default tabs remove their content from the DOM while it's off-screen.
168
174
* Setting this to `true` will keep it in the DOM which will prevent elements
169
175
* like iframes and videos from reloading next time it comes back into the view.
170
176
*/
171
177
@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 ;
173
185
174
186
/** Background color of the tab group. */
175
187
@Input ( )
Original file line number Diff line number Diff line change @@ -233,7 +233,8 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
233
233
protected _changeDetectorRef: ChangeDetectorRef ;
234
234
get contentTabIndex(): number | null ;
235
235
set contentTabIndex(value : NumberInput );
236
- disablePagination: boolean ;
236
+ get disablePagination(): boolean ;
237
+ set disablePagination(value : BooleanInput );
237
238
get dynamicHeight(): boolean ;
238
239
set dynamicHeight(value : BooleanInput );
239
240
readonly focusChange: EventEmitter <MatTabChangeEvent >;
@@ -250,7 +251,8 @@ export abstract class _MatTabGroupBase extends _MatTabGroupMixinBase implements
250
251
ngAfterContentInit(): void ;
251
252
// (undocumented)
252
253
ngOnDestroy(): void ;
253
- preserveContent: boolean ;
254
+ get preserveContent(): boolean ;
255
+ set preserveContent(value : BooleanInput );
254
256
realignInkBar(): void ;
255
257
_removeTabBodyWrapperHeight(): void ;
256
258
get selectedIndex(): number | null ;
You can’t perform that action at this time.
0 commit comments