Skip to content

Commit 70d416f

Browse files
authored
refactor(cdk/a11y): un-deprecate focus trap (#28768)
The `FocusTrap` and `FocusTrapFactory` symbols were marked as deprecated a while ago, but the only way to provide the `ConfigurableFocusTrap` is to reference the deprecated symbols. These changes un-deprecate the former to avoid confusion.
1 parent 1fe7c55 commit 70d416f

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

src/cdk/a11y/focus-trap/focus-trap.ts

-5
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ import {InteractivityChecker} from '../interactivity-checker/interactivity-check
3232
* This class currently uses a relatively simple approach to focus trapping.
3333
* It assumes that the tab order is the same as DOM order, which is not necessarily true.
3434
* Things like `tabIndex > 0`, flex `order`, and shadow roots can cause the two to be misaligned.
35-
*
36-
* @deprecated Use `ConfigurableFocusTrap` instead.
37-
* @breaking-change 11.0.0
3835
*/
3936
export class FocusTrap {
4037
private _startAnchor: HTMLElement | null;
@@ -368,8 +365,6 @@ export class FocusTrap {
368365

369366
/**
370367
* Factory that allows easy instantiation of focus traps.
371-
* @deprecated Use `ConfigurableFocusTrapFactory` instead.
372-
* @breaking-change 11.0.0
373368
*/
374369
@Injectable({providedIn: 'root'})
375370
export class FocusTrapFactory {

tools/public_api_guard/cdk/a11y.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ export { FocusOptions_2 as FocusOptions }
217217
// @public (undocumented)
218218
export type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null;
219219

220-
// @public @deprecated
220+
// @public
221221
export class FocusTrap {
222222
constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, deferAnchors?: boolean);
223223
attachAnchors(): boolean;
@@ -246,7 +246,7 @@ export class FocusTrap {
246246
protected toggleAnchors(enabled: boolean): void;
247247
}
248248

249-
// @public @deprecated
249+
// @public
250250
export class FocusTrapFactory {
251251
constructor(_checker: InteractivityChecker, _ngZone: NgZone, _document: any);
252252
create(element: HTMLElement, deferCaptureElements?: boolean): FocusTrap;

0 commit comments

Comments
 (0)