File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " @floating-ui/utils " : patch
3
+ ---
4
+
5
+ feat(getContainingBlock): allow ` CSSStyleDeclaration ` as an argument
Original file line number Diff line number Diff line change @@ -68,9 +68,11 @@ export function isTopLayer(element: Element): boolean {
68
68
} ) ;
69
69
}
70
70
71
- export function isContainingBlock ( element : Element ) : boolean {
71
+ export function isContainingBlock ( element : Element ) : boolean ;
72
+ export function isContainingBlock ( css : CSSStyleDeclaration ) : boolean ;
73
+ export function isContainingBlock ( elementOrCss : Element | CSSStyleDeclaration ) : boolean {
72
74
const webkit = isWebKit ( ) ;
73
- const css = getComputedStyle ( element ) ;
75
+ const css = isElement ( elementOrCss ) ? getComputedStyle ( elementOrCss ) : elementOrCss ;
74
76
75
77
// https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
76
78
return (
You can’t perform that action at this time.
0 commit comments