Skip to content

Commit 357d1c3

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. (cherry picked from commit 2c1c30a)
1 parent 57b2c3f commit 357d1c3

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
@@ -140,7 +140,10 @@ export class DragDropRegistry<I, C extends {id: string}> implements OnDestroy {
140140
options: true
141141
})
142142
.set('scroll', {
143-
handler: (e: Event) => this.scroll.next(e)
143+
handler: (e: Event) => this.scroll.next(e),
144+
// Use capturing so that we pick up scroll changes in any scrollable nodes that aren't
145+
// the document. See https://github.com/angular/components/issues/17144.
146+
options: true
144147
})
145148
// Preventing the default action on `mousemove` isn't enough to disable text selection
146149
// on Safari so we need to prevent the selection event as well. Alternatively this can

0 commit comments

Comments
 (0)