@@ -49,13 +49,6 @@ enum AutoScrollHorizontalDirection {
49
49
RIGHT ,
50
50
}
51
51
52
- type RootNode = DocumentOrShadowRoot & {
53
- // As of TS 4.4 the built in DOM typings don't include `elementFromPoint` on `ShadowRoot`,
54
- // even though it exists (see https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot).
55
- // This type is a utility to avoid having to add casts everywhere.
56
- elementFromPoint ( x : number , y : number ) : Element | null ;
57
- } ;
58
-
59
52
/**
60
53
* Reference to a drop list. Used to manipulate or dispose of the container.
61
54
*/
@@ -181,7 +174,7 @@ export class DropListRef<T = any> {
181
174
private readonly _stopScrollTimers = new Subject < void > ( ) ;
182
175
183
176
/** Shadow root of the current element. Necessary for `elementFromPoint` to resolve correctly. */
184
- private _cachedShadowRoot : RootNode | null = null ;
177
+ private _cachedShadowRoot : DocumentOrShadowRoot | null = null ;
185
178
186
179
/** Reference to the document. */
187
180
private _document : Document ;
@@ -760,10 +753,10 @@ export class DropListRef<T = any> {
760
753
* in order to ensure that the element has been moved into the shadow DOM. Doing it inside the
761
754
* constructor might be too early if the element is inside of something like `ngFor` or `ngIf`.
762
755
*/
763
- private _getShadowRoot ( ) : RootNode {
756
+ private _getShadowRoot ( ) : DocumentOrShadowRoot {
764
757
if ( ! this . _cachedShadowRoot ) {
765
758
const shadowRoot = _getShadowRoot ( this . _container ) ;
766
- this . _cachedShadowRoot = ( shadowRoot || this . _document ) as RootNode ;
759
+ this . _cachedShadowRoot = shadowRoot || this . _document ;
767
760
}
768
761
769
762
return this . _cachedShadowRoot ;
0 commit comments