Skip to content

Commit 85f81ab

Browse files
committed
master - 816099e76 Revert "feat(material/tabs): add the ability to keep content inside the DOM while off-screen (#20393)" (#24298)
1 parent 436cfd9 commit 85f81ab

File tree

22 files changed

+33
-237
lines changed

22 files changed

+33
-237
lines changed

docs-content/api-docs/material-tabs.html

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -953,22 +953,6 @@ <h4 id="MatTabGroup" class="docs-header-link docs-api-h4 docs-api-class-name">
953953

954954

955955

956-
<tr class="docs-api-properties-row">
957-
<td class="docs-api-properties-name-cell"><div class="docs-api-input-marker">
958-
@Input()</div><p class="docs-api-property-name">
959-
<code>preserveContent: boolean</code>
960-
</p>
961-
</td>
962-
<td class="docs-api-property-description"><p>By default tabs remove their content from the DOM while it&#39;s off-screen.
963-
Setting this to <code>true</code> will keep it in the DOM which will prevent elements
964-
like iframes and videos from reloading next time it comes back into the view.</p>
965-
</td>
966-
</tr>
967-
968-
969-
970-
971-
972956
<tr class="docs-api-properties-row">
973957
<td class="docs-api-properties-name-cell"><div class="docs-api-input-marker">
974958
@Input()</div><p class="docs-api-property-name">
@@ -1268,21 +1252,6 @@ <h4 id="MatTabsConfig" class="docs-header-link docs-api-h4 docs-api-interface-na
12681252

12691253

12701254

1271-
1272-
1273-
<tr class="docs-api-properties-row">
1274-
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
1275-
<code>preserveContent: boolean</code>
1276-
</p>
1277-
</td>
1278-
<td class="docs-api-property-description"><p>By default tabs remove their content from the DOM while it&#39;s off-screen.
1279-
Setting this to <code>true</code> will keep it in the DOM which will prevent elements
1280-
like iframes and videos from reloading next time it comes back into the view.</p>
1281-
</td>
1282-
</tr>
1283-
1284-
1285-
12861255
</table>
12871256

12881257

docs-content/examples-highlighted/material/tabs/index-ts.html

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
<span class="hljs-keyword">import</span> {TabGroupDynamicExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-dynamic/tab-group-dynamic-example&#x27;</span>;
1818
<span class="hljs-keyword">import</span> {TabGroupHeaderBelowExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-header-below/tab-group-header-below-example&#x27;</span>;
1919
<span class="hljs-keyword">import</span> {TabGroupLazyLoadedExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-lazy-loaded/tab-group-lazy-loaded-example&#x27;</span>;
20-
<span class="hljs-keyword">import</span> {TabGroupPreserveContentExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-preserve-content/tab-group-preserve-content-example&#x27;</span>;
2120
<span class="hljs-keyword">import</span> {TabGroupStretchedExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-stretched/tab-group-stretched-example&#x27;</span>;
2221
<span class="hljs-keyword">import</span> {TabGroupThemeExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-group-theme/tab-group-theme-example&#x27;</span>;
2322
<span class="hljs-keyword">import</span> {TabNavBarBasicExample} <span class="hljs-keyword">from</span> <span class="hljs-string">&#x27;./tab-nav-bar-basic/tab-nav-bar-basic-example&#x27;</span>;
@@ -38,7 +37,6 @@
3837
TabGroupThemeExample,
3938
TabNavBarBasicExample,
4039
TabNavBarWithPanelExample,
41-
TabGroupPreserveContentExample,
4240
};
4341

4442
<span class="hljs-keyword">const</span> EXAMPLES = [
@@ -56,7 +54,6 @@
5654
TabGroupThemeExample,
5755
TabNavBarBasicExample,
5856
TabNavBarWithPanelExample,
59-
TabGroupPreserveContentExample,
6057
];
6158

6259
<span class="hljs-meta">@NgModule</span>({

docs-content/examples-highlighted/material/tabs/tab-group-preserve-content/tab-group-preserve-content-example-html.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs-content/examples-highlighted/material/tabs/tab-group-preserve-content/tab-group-preserve-content-example-ts.html

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs-content/examples-source/material/tabs/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ import {TabGroupHarnessExample} from './tab-group-harness/tab-group-harness-exam
1717
import {TabGroupDynamicExample} from './tab-group-dynamic/tab-group-dynamic-example';
1818
import {TabGroupHeaderBelowExample} from './tab-group-header-below/tab-group-header-below-example';
1919
import {TabGroupLazyLoadedExample} from './tab-group-lazy-loaded/tab-group-lazy-loaded-example';
20-
import {TabGroupPreserveContentExample} from './tab-group-preserve-content/tab-group-preserve-content-example';
2120
import {TabGroupStretchedExample} from './tab-group-stretched/tab-group-stretched-example';
2221
import {TabGroupThemeExample} from './tab-group-theme/tab-group-theme-example';
2322
import {TabNavBarBasicExample} from './tab-nav-bar-basic/tab-nav-bar-basic-example';
@@ -38,7 +37,6 @@ export {
3837
TabGroupThemeExample,
3938
TabNavBarBasicExample,
4039
TabNavBarWithPanelExample,
41-
TabGroupPreserveContentExample,
4240
};
4341

4442
const EXAMPLES = [
@@ -56,7 +54,6 @@ const EXAMPLES = [
5654
TabGroupThemeExample,
5755
TabNavBarBasicExample,
5856
TabNavBarWithPanelExample,
59-
TabGroupPreserveContentExample,
6057
];
6158

6259
@NgModule({

docs-content/examples-source/material/tabs/tab-group-preserve-content/tab-group-preserve-content-example.html

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs-content/examples-source/material/tabs/tab-group-preserve-content/tab-group-preserve-content-example.ts

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs-content/overviews/material/tabs/tabs.html

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,6 @@ <h3 id="controlling-the-tab-animation" class="docs-header-link">
9696
region="slow-animation-duration"></div>
9797

9898

99-
<h3 id="keeping-the-tab-content-inside-the-dom-while-its-off-screen" class="docs-header-link">
100-
<span header-link="keeping-the-tab-content-inside-the-dom-while-its-off-screen"></span>
101-
Keeping the tab content inside the DOM while it&#39;s off-screen
102-
</h3>
103-
<p>By default the <code>&lt;mat-tab-group&gt;</code> will remove the content of off-screen tabs from the DOM until they
104-
come into the view. This is optimal for most cases since it keeps the DOM size smaller, but it
105-
isn&#39;t great for others like when a tab has an <code>&lt;audio&gt;</code> or <code>&lt;video&gt;</code> element, because the content
106-
will be re-initialized whenever the user navigates to the tab. If you want to keep the content of
107-
off-screen tabs in the DOM, you can set the <code>preserveContent</code> input to <code>true</code>.</p>
108-
<div material-docs-example="tab-group-preserve-content"></div>
109-
110-
11199
<h3 id="accessibility" class="docs-header-link">
112100
<span header-link="accessibility"></span>
113101
Accessibility

esm2020/example-module.mjs

Lines changed: 1 addition & 17 deletions
Large diffs are not rendered by default.

esm2020/material/tabs/index.mjs

Lines changed: 4 additions & 8 deletions
Large diffs are not rendered by default.

esm2020/material/tabs/tab-group-preserve-content/tab-group-preserve-content-example.mjs

Lines changed: 0 additions & 15 deletions
This file was deleted.

fesm2015/components-examples.mjs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4844,22 +4844,6 @@ const EXAMPLE_COMPONENTS = {
48444844
"importSpecifier": "material/tabs"
48454845
}
48464846
},
4847-
"tab-group-preserve-content": {
4848-
"packagePath": "material/tabs/tab-group-preserve-content",
4849-
"title": "Tab group that keeps its content inside the DOM when it's off-screen.",
4850-
"componentName": "TabGroupPreserveContentExample",
4851-
"files": [
4852-
"tab-group-preserve-content-example.ts",
4853-
"tab-group-preserve-content-example.html"
4854-
],
4855-
"selector": "tab-group-preserve-content-example",
4856-
"additionalComponents": [],
4857-
"primaryFile": "tab-group-preserve-content-example.ts",
4858-
"module": {
4859-
"name": "TabGroupExamplesModule",
4860-
"importSpecifier": "material/tabs"
4861-
}
4862-
},
48634847
"tab-group-stretched": {
48644848
"packagePath": "material/tabs/tab-group-stretched",
48654849
"title": "Tab group with stretched labels",

fesm2015/components-examples.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fesm2015/material/tabs.mjs

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -172,18 +172,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
172172
args: [{ selector: 'tab-group-lazy-loaded-example', template: "<mat-tab-group>\n<!-- #docregion mat-tab-content -->\n <mat-tab label=\"First\">\n <ng-template matTabContent>\n Content 1 - Loaded: {{getTimeLoaded(1) | date:'medium'}}\n </ng-template>\n </mat-tab>\n<!-- #enddocregion mat-tab-content -->\n <mat-tab label=\"Second\">\n <ng-template matTabContent>\n Content 2 - Loaded: {{getTimeLoaded(2) | date:'medium'}}\n </ng-template>\n </mat-tab>\n <mat-tab label=\"Third\">\n <ng-template matTabContent>\n Content 3 - Loaded: {{getTimeLoaded(3) | date:'medium'}}\n </ng-template>\n </mat-tab>\n</mat-tab-group>\n" }]
173173
}] });
174174

175-
/**
176-
* @title Tab group that keeps its content inside the DOM when it's off-screen.
177-
*/
178-
class TabGroupPreserveContentExample {
179-
}
180-
TabGroupPreserveContentExample.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: TabGroupPreserveContentExample, deps: [], target: i0.ɵɵFactoryTarget.Component });
181-
TabGroupPreserveContentExample.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.0-rc.1", type: TabGroupPreserveContentExample, selector: "tab-group-preserve-content-example", ngImport: i0, template: "<p>Start the video in the first tab and navigate to the second one to see how it keeps playing.</p>\n\n<mat-tab-group [preserveContent]=\"true\">\n <mat-tab label=\"First\">\n <iframe\n width=\"560\"\n height=\"315\"\n src=\"https://www.youtube.com/embed/B-lipaiZII8\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen></iframe>\n </mat-tab>\n <mat-tab label=\"Second\">Note how the video from the previous tab is still playing.</mat-tab>\n</mat-tab-group>\n", components: [{ type: i1.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "disableRipple"], exportAs: ["matTabGroup"] }, { type: i1.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }] });
182-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: TabGroupPreserveContentExample, decorators: [{
183-
type: Component,
184-
args: [{ selector: 'tab-group-preserve-content-example', template: "<p>Start the video in the first tab and navigate to the second one to see how it keeps playing.</p>\n\n<mat-tab-group [preserveContent]=\"true\">\n <mat-tab label=\"First\">\n <iframe\n width=\"560\"\n height=\"315\"\n src=\"https://www.youtube.com/embed/B-lipaiZII8\"\n frameborder=\"0\"\n allow=\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\"\n allowfullscreen></iframe>\n </mat-tab>\n <mat-tab label=\"Second\">Note how the video from the previous tab is still playing.</mat-tab>\n</mat-tab-group>\n" }]
185-
}] });
186-
187175
/**
188176
* @title Tab group with stretched labels
189177
*/
@@ -262,7 +250,6 @@ const EXAMPLES = [
262250
TabGroupThemeExample,
263251
TabNavBarBasicExample,
264252
TabNavBarWithPanelExample,
265-
TabGroupPreserveContentExample,
266253
];
267254
class TabGroupExamplesModule {
268255
}
@@ -280,8 +267,7 @@ TabGroupExamplesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
280267
TabGroupStretchedExample,
281268
TabGroupThemeExample,
282269
TabNavBarBasicExample,
283-
TabNavBarWithPanelExample,
284-
TabGroupPreserveContentExample], imports: [CommonModule,
270+
TabNavBarWithPanelExample], imports: [CommonModule,
285271
MatButtonModule,
286272
MatButtonToggleModule,
287273
MatCheckboxModule,
@@ -301,8 +287,7 @@ TabGroupExamplesModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0",
301287
TabGroupStretchedExample,
302288
TabGroupThemeExample,
303289
TabNavBarBasicExample,
304-
TabNavBarWithPanelExample,
305-
TabGroupPreserveContentExample] });
290+
TabNavBarWithPanelExample] });
306291
TabGroupExamplesModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: TabGroupExamplesModule, imports: [[
307292
CommonModule,
308293
MatButtonModule,
@@ -335,5 +320,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ng
335320
* Generated bundle index. Do not edit.
336321
*/
337322

338-
export { TabGroupAlignExample, TabGroupAnimationsExample, TabGroupAsyncExample, TabGroupBasicExample, TabGroupCustomLabelExample, TabGroupDynamicExample, TabGroupDynamicHeightExample, TabGroupExamplesModule, TabGroupHarnessExample, TabGroupHeaderBelowExample, TabGroupLazyLoadedExample, TabGroupPreserveContentExample, TabGroupStretchedExample, TabGroupThemeExample, TabNavBarBasicExample, TabNavBarWithPanelExample };
323+
export { TabGroupAlignExample, TabGroupAnimationsExample, TabGroupAsyncExample, TabGroupBasicExample, TabGroupCustomLabelExample, TabGroupDynamicExample, TabGroupDynamicHeightExample, TabGroupExamplesModule, TabGroupHarnessExample, TabGroupHeaderBelowExample, TabGroupLazyLoadedExample, TabGroupStretchedExample, TabGroupThemeExample, TabNavBarBasicExample, TabNavBarWithPanelExample };
339324
//# sourceMappingURL=tabs.mjs.map

fesm2015/material/tabs.mjs.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)