Skip to content

Commit 2c1c30a

Browse files
crisbetoandrewseguin
authored andcommitted
fix(drag-drop): unable to drop into connected sibling after scrolling into view via the parent (#17162)
In #16681 we added some logic that updates the cached dimensions if the document is scrolled while dragging, however it didn't account for any scrollable parent nodes that might've been scrolled. These changes switch the event listener to use capturing so that we can pick up all of the elements being scrolled. Fixes #17144.
1 parent 2cefb69 commit 2c1c30a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/cdk/drag-drop/drag-drop-registry.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ export class DragDropRegistry<I, C> implements OnDestroy {
136136
options: true
137137
})
138138
.set('scroll', {
139-
handler: (e: Event) => this.scroll.next(e)
139+
handler: (e: Event) => this.scroll.next(e),
140+
// Use capturing so that we pick up scroll changes in any scrollable nodes that aren't
141+
// the document. See https://github.com/angular/components/issues/17144.
142+
options: true
140143
})
141144
// Preventing the default action on `mousemove` isn't enough to disable text selection
142145
// on Safari so we need to prevent the selection event as well. Alternatively this can

0 commit comments

Comments
 (0)