From fe9f84f728ca6fc4ba5156e6f9637be700b3350d Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Fri, 22 Mar 2024 10:54:59 +0100 Subject: [PATCH] refactor(cdk/a11y): un-deprecate focus trap 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. --- src/cdk/a11y/focus-trap/focus-trap.ts | 5 ----- tools/public_api_guard/cdk/a11y.md | 4 ++-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/cdk/a11y/focus-trap/focus-trap.ts b/src/cdk/a11y/focus-trap/focus-trap.ts index cb7726f8d48d..2b7b62f09335 100644 --- a/src/cdk/a11y/focus-trap/focus-trap.ts +++ b/src/cdk/a11y/focus-trap/focus-trap.ts @@ -32,9 +32,6 @@ import {InteractivityChecker} from '../interactivity-checker/interactivity-check * This class currently uses a relatively simple approach to focus trapping. * It assumes that the tab order is the same as DOM order, which is not necessarily true. * Things like `tabIndex > 0`, flex `order`, and shadow roots can cause the two to be misaligned. - * - * @deprecated Use `ConfigurableFocusTrap` instead. - * @breaking-change 11.0.0 */ export class FocusTrap { private _startAnchor: HTMLElement | null; @@ -368,8 +365,6 @@ export class FocusTrap { /** * Factory that allows easy instantiation of focus traps. - * @deprecated Use `ConfigurableFocusTrapFactory` instead. - * @breaking-change 11.0.0 */ @Injectable({providedIn: 'root'}) export class FocusTrapFactory { diff --git a/tools/public_api_guard/cdk/a11y.md b/tools/public_api_guard/cdk/a11y.md index b7e6a0677b3c..3b59563867d5 100644 --- a/tools/public_api_guard/cdk/a11y.md +++ b/tools/public_api_guard/cdk/a11y.md @@ -215,7 +215,7 @@ export { FocusOptions_2 as FocusOptions } // @public (undocumented) export type FocusOrigin = 'touch' | 'mouse' | 'keyboard' | 'program' | null; -// @public @deprecated +// @public export class FocusTrap { constructor(_element: HTMLElement, _checker: InteractivityChecker, _ngZone: NgZone, _document: Document, deferAnchors?: boolean); attachAnchors(): boolean; @@ -244,7 +244,7 @@ export class FocusTrap { protected toggleAnchors(enabled: boolean): void; } -// @public @deprecated +// @public export class FocusTrapFactory { constructor(_checker: InteractivityChecker, _ngZone: NgZone, _document: any); create(element: HTMLElement, deferCaptureElements?: boolean): FocusTrap;