Skip to content

Commit

Permalink
fix(cdk/drag-drop): reset pointer events on descendants (#29370)
Browse files Browse the repository at this point in the history
When we create the preview and placeholder, we set `pointer-events: none` on them so they don't interfere with the `elementFromPoint` calls, however descendants of the element could be resetting it back to `auto` for themselves. These changes update the reset to prevent it from happening.

(cherry picked from commit bfa3ac5)
  • Loading branch information
crisbeto committed Jul 4, 2024
1 parent 585fec6 commit 03d4e13
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/cdk/drag-drop/resets.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,10 @@
color: inherit;
}
}

// These elements get `pointer-events: none` when they're created, but any descendants might
// override it back to `auto`. Reset them here since they can affect the pointer position detection.
.cdk-drag-placeholder *,
.cdk-drag-preview * {
pointer-events: none !important;
}

0 comments on commit 03d4e13

Please sign in to comment.