@@ -50,19 +50,19 @@ const activeCapturingEventOptions = {
50
50
} )
51
51
export class _ResetsLoader { }
52
52
53
- // TODO(crisbeto): remove generics when making breaking changes.
54
53
/**
55
54
* Service that keeps track of all the drag item and drop container
56
55
* instances, and manages global event listeners on the `document`.
57
56
* @docs -private
58
57
*/
59
58
@Injectable ( { providedIn : 'root' } )
60
- export class DragDropRegistry < _ = unknown , __ = unknown > implements OnDestroy {
59
+ export class DragDropRegistry implements OnDestroy {
61
60
private _ngZone = inject ( NgZone ) ;
62
61
private _document = inject ( DOCUMENT ) ;
63
62
private _styleLoader = inject ( _CdkPrivateStyleLoader ) ;
64
63
private _renderer = inject ( RendererFactory2 ) . createRenderer ( null , null ) ;
65
64
private _cleanupDocumentTouchmove : ( ( ) => void ) | undefined ;
65
+ private _scroll : Subject < Event > = new Subject < Event > ( ) ;
66
66
67
67
/** Registered drop container instances. */
68
68
private _dropInstances = new Set < DropListRef > ( ) ;
@@ -101,13 +101,6 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
101
101
*/
102
102
readonly pointerUp : Subject < TouchEvent | MouseEvent > = new Subject < TouchEvent | MouseEvent > ( ) ;
103
103
104
- /**
105
- * Emits when the viewport has been scrolled while the user is dragging an item.
106
- * @deprecated To be turned into a private member. Use the `scrolled` method instead.
107
- * @breaking -change 13.0.0
108
- */
109
- readonly scroll : Subject < Event > = new Subject < Event > ( ) ;
110
-
111
104
constructor ( ...args : unknown [ ] ) ;
112
105
constructor ( ) { }
113
106
@@ -180,7 +173,7 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
180
173
const toBind : [ name : string , handler : ( event : Event ) => void , options : _ListenerOptions ] [ ] = [
181
174
// Use capturing so that we pick up scroll changes in any scrollable nodes that aren't
182
175
// the document. See https://github.com/angular/components/issues/17144.
183
- [ 'scroll' , ( e : Event ) => this . scroll . next ( e ) , capturingEventOptions ] ,
176
+ [ 'scroll' , ( e : Event ) => this . _scroll . next ( e ) , capturingEventOptions ] ,
184
177
185
178
// Preventing the default action on `mousemove` isn't enough to disable text selection
186
179
// on Safari so we need to prevent the selection event as well. Alternatively this can
@@ -245,7 +238,7 @@ export class DragDropRegistry<_ = unknown, __ = unknown> implements OnDestroy {
245
238
* be used to include an additional top-level listener at the shadow root level.
246
239
*/
247
240
scrolled ( shadowRoot ?: DocumentOrShadowRoot | null ) : Observable < Event > {
248
- const streams : Observable < Event > [ ] = [ this . scroll ] ;
241
+ const streams : Observable < Event > [ ] = [ this . _scroll ] ;
249
242
250
243
if ( shadowRoot && shadowRoot !== this . _document ) {
251
244
// Note that this is basically the same as `fromEvent` from rxjs, but we do it ourselves,
0 commit comments