Skip to content

Commit

Permalink
fix(overlay): expand flexible origin type to allow SVG elements (#19199)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
crisbeto authored and jelbourn committed Apr 29, 2020
1 parent d071352 commit bee88e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const boundingBoxClass = 'cdk-overlay-connected-position-bounding-box';
const cssUnitPattern = /([A-Za-z%]+)$/;

/** Possible values that can be set as the origin of a FlexibleConnectedPositionStrategy. */
export type FlexibleConnectedPositionStrategyOrigin = ElementRef | HTMLElement | Point & {
export type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | Point & {
width?: number;
height?: number;
};
Expand Down
2 changes: 1 addition & 1 deletion tools/public_api_guard/cdk/overlay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export declare class FlexibleConnectedPositionStrategy implements PositionStrate
withViewportMargin(margin: number): this;
}

export declare type FlexibleConnectedPositionStrategyOrigin = ElementRef | HTMLElement | Point & {
export declare type FlexibleConnectedPositionStrategyOrigin = ElementRef | Element | Point & {
width?: number;
height?: number;
};
Expand Down

0 comments on commit bee88e1

Please sign in to comment.