Skip to content

Commit d321d45

Browse files
authored
fix(overlay): expand flexible origin type to allow SVG elements (#19199)
The typing of the `FlexibleConnectedPositionStrategyOrigin` is scoped to `HTMLElement` which doesn't cover `SVGElement`, even though we support it. These changes update the type. Note that this should be a safe change to the public API, because we're widening the type. Fixes #36381.
1 parent 33607dc commit d321d45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/cdk/overlay/position/flexible-connected-position-strategy.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
3333
const cssUnitPattern = /([A-Za-z%]+)$/;
3434

3535
/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */
36-
export type FlexibleConnectedPositionStrategyOrigin = ElementRef | HTMLElement | Point & {
36+
export type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | Point & {
3737
width?: number;
3838
height?: number;
3939
};

tools/public_api_guard/cdk/overlay.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ export declare class FlexibleConnectedPositionStrategy implements PositionStrate
146146
withViewportMargin(margin: number): this;
147147
}
148148

149-
export declare type FlexibleConnectedPositionStrategyOrigin = ElementRef | HTMLElement | Point & {
149+
export declare type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | Point & {
150150
width?: number;
151151
height?: number;
152152
};

0 commit comments

Comments
 (0)