Skip to content

Commit

Permalink
fix(drag-drop): unable to drop into connected sibling after scrolling…
Browse files Browse the repository at this point in the history
… into view via the parent

In angular#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 angular#17144.
  • Loading branch information
crisbeto committed Sep 21, 2019
1 parent 7f6972f commit cbdb38f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cdk/drag-drop/drag-drop-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ export class DragDropRegistry<I, C> implements OnDestroy {
options: true
})
.set('scroll', {
handler: (e: Event) => this.scroll.next(e)
handler: (e: Event) => this.scroll.next(e),
// Use capturing so that we pick up scroll changes in any scrollable nodes that aren't
// the document. See https://github.com/angular/components/issues/17144.
options: true
})
// Preventing the default action on `mousemove` isn't enough to disable text selection
// on Safari so we need to prevent the selection event as well. Alternatively this can
Expand Down

0 comments on commit cbdb38f

Please sign in to comment.