File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -63,11 +63,10 @@ function scrollIntoView<T>(
63
63
) : T
64
64
function scrollIntoView ( target : Element , options ?: Options | boolean ) : void
65
65
function scrollIntoView < T > ( target : Element , options ?: Options < T > | boolean ) {
66
- // Browsers treats targets that aren't in the dom as a no-op
67
- const scrollingElement = ( document . scrollingElement ||
68
- document . documentElement ) as Element
69
- const targetIsDetached =
70
- target !== scrollingElement && ! scrollingElement . contains ( target )
66
+ // Browsers treats targets that aren't in the dom as a no-op and so should we
67
+ const targetIsDetached = ! target . ownerDocument ! . documentElement ! . contains (
68
+ target
69
+ )
71
70
72
71
if (
73
72
isOptionsObject < CustomBehaviorOptions < T > > ( options ) &&
You can’t perform that action at this time.
0 commit comments