Skip to content

Commit 6b37e06

Browse files
committed
main - f6b7739 fix(multiple): expand type for restoreFocus (#32877)
1 parent 275e62e commit 6b37e06

4 files changed

Lines changed: 35 additions & 23 deletions

File tree

docs-content/api-docs/cdk-dialog.html

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -755,17 +755,10 @@ <h4 id="DialogConfig" class="docs-header-link docs-api-h4 docs-api-class-name">
755755

756756
<tr class="docs-api-properties-row">
757757
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
758-
<code>restoreFocus: <code class="docs-api-property-type">boolean | string | HTMLElement</code></code>
758+
<code>restoreFocus: <code class="docs-api-property-type">RestoreFocusValue</code></code>
759759
</p>
760760
</td>
761-
<td class="docs-api-property-description"><p>Whether the dialog should restore focus to the previously-focused element upon closing.
762-
Has the following behavior based on the type that is passed in:</p>
763-
<ul>
764-
<li><code>boolean</code> - when true, will return focus to the element that was focused before the dialog
765-
was opened, otherwise won&#39;t restore focus at all.</li>
766-
<li><code>string</code> - focus will be restored to the first element that matches the CSS selector.</li>
767-
<li><code>HTMLElement</code> - focus will be restored to the specific element.</li>
768-
</ul>
761+
<td class="docs-api-property-description"><p>Configures the focus restoration behavior. See <code>RestoreFocusValue</code> for more information.</p>
769762
</td>
770763
</tr>
771764

@@ -1368,6 +1361,27 @@ <h4 id="AutoFocusTarget" class="docs-header-link docs-api-h4 docs-api-type-alias
13681361

13691362

13701363

1364+
<h4 id="RestoreFocusValue" class="docs-header-link docs-api-h4 docs-api-type-alias-name">
1365+
<span header-link="RestoreFocusValue"></span>
1366+
<code>RestoreFocusValue</code>
1367+
</h4><p class="docs-api-type-alias-description"><p>Value that determines the focus restoration behavior for a dialog.
1368+
The values represent the following behaviors:</p>
1369+
<ul>
1370+
<li><code>boolean</code> - when true, will return focus to the element that was focused before the dialog
1371+
was opened, otherwise won&#39;t restore focus at all.</li>
1372+
<li><code>string</code> - focus will be restored to the first element that matches the CSS selector.</li>
1373+
<li><code>HTMLElement</code> - focus will be restored to the specific element.</li>
1374+
</ul>
1375+
</p><div class="docs-markdown">
1376+
<pre class="docs-markdown-pre">
1377+
<code class="docs-markdown-code">type RestoreFocusValue = boolean | string | HTMLElement;</code>
1378+
</pre>
1379+
</div>
1380+
1381+
1382+
1383+
1384+
13711385
<h4 id="DialogRole" class="docs-header-link docs-api-h4 docs-api-type-alias-name">
13721386
<span header-link="DialogRole"></span>
13731387
<code>DialogRole</code>

docs-content/api-docs/material-bottom-sheet.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -443,11 +443,10 @@ <h4 id="MatBottomSheetConfig" class="docs-header-link docs-api-h4 docs-api-class
443443

444444
<tr class="docs-api-properties-row">
445445
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
446-
<code>restoreFocus: <code class="docs-api-property-type">boolean</code></code>
446+
<code>restoreFocus: <code class="docs-api-property-type">RestoreFocusValue</code></code>
447447
</p>
448448
</td>
449-
<td class="docs-api-property-description"><p>Whether the bottom sheet should restore focus to the
450-
previously-focused element, after it&#39;s closed.</p>
449+
<td class="docs-api-property-description"><p>Configures the focus restoration behavior. See <code>RestoreFocusValue</code> for more information.</p>
451450
</td>
452451
</tr>
453452

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,11 +1322,10 @@ <h4 id="MatDialogConfig" class="docs-header-link docs-api-h4 docs-api-class-name
13221322

13231323
<tr class="docs-api-properties-row">
13241324
<td class="docs-api-properties-name-cell"><p class="docs-api-property-name">
1325-
<code>restoreFocus: <code class="docs-api-property-type">boolean</code></code>
1325+
<code>restoreFocus: <code class="docs-api-property-type">RestoreFocusValue</code></code>
13261326
</p>
13271327
</td>
1328-
<td class="docs-api-property-description"><p>Whether the dialog should restore focus to the
1329-
previously-focused element, after it&#39;s closed.</p>
1328+
<td class="docs-api-property-description"><p>Configures the focus restoration behavior. See <code>RestoreFocusValue</code> for more information.</p>
13301329
</td>
13311330
</tr>
13321331

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular/components-examples",
3-
"version": "21.3.0-next.0+sha-f24fb4e",
3+
"version": "21.3.0-next.0+sha-f6b7739",
44
"description": "Angular Components Examples",
55
"private": true,
66
"repository": {
@@ -255,15 +255,15 @@
255255
},
256256
"homepage": "https://github.com/angular/components#readme",
257257
"peerDependencies": {
258-
"@angular/aria": "21.3.0-next.0+sha-f24fb4e",
259-
"@angular/cdk": "21.3.0-next.0+sha-f24fb4e",
260-
"@angular/cdk-experimental": "21.3.0-next.0+sha-f24fb4e",
258+
"@angular/aria": "21.3.0-next.0+sha-f6b7739",
259+
"@angular/cdk": "21.3.0-next.0+sha-f6b7739",
260+
"@angular/cdk-experimental": "21.3.0-next.0+sha-f6b7739",
261261
"@angular/core": "^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0",
262262
"@angular/common": "^21.0.0-0 || ^21.1.0-0 || ^21.2.0-0 || ^21.3.0-0 || ^22.0.0-0",
263-
"@angular/material": "21.3.0-next.0+sha-f24fb4e",
264-
"@angular/material-experimental": "21.3.0-next.0+sha-f24fb4e",
265-
"@angular/material-luxon-adapter": "21.3.0-next.0+sha-f24fb4e",
266-
"@angular/material-date-fns-adapter": "21.3.0-next.0+sha-f24fb4e"
263+
"@angular/material": "21.3.0-next.0+sha-f6b7739",
264+
"@angular/material-experimental": "21.3.0-next.0+sha-f6b7739",
265+
"@angular/material-luxon-adapter": "21.3.0-next.0+sha-f6b7739",
266+
"@angular/material-date-fns-adapter": "21.3.0-next.0+sha-f6b7739"
267267
},
268268
"devDependencies": {
269269
"@angular/aria": "workspace:*",

0 commit comments

Comments
 (0)