You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(cdk/drag-drop): allow for preview container to be customized (#21830)
Currently we always insert the drag preview at the `body`, because it allows us to avoid
dealing with `overflow` and `z-index`. The problem is that it doesn't allow the preview to
retain its inherited styles.
These changes add a new input which allows the consumer to configure the place into
which the preview will be inserted.
Fixes#13288.
| `global` | Default value. Preview is inserted into the `<body>` or the closest shadow root. | Preview won't be affected by `z-index` or `overflow: hidden`. It also won't affect `:nth-child` selectors and flex layouts. | Doesn't retain inherited styles.
140
+
| `parent` | Preview is inserted inside the parent of the item that is being dragged. | Preview inherits the same styles as the dragged item. | Preview may be clipped by `overflow: hidden` or be placed under other elements due to `z-index`. Furthermore, it can affect `:nth-child` selectors and some flex layouts.
141
+
| `ElementRef` or `HTMLElement` | Preview will be inserted into the specified element. | Preview inherits styles from the specified container element. | Preview may be clipped by `overflow: hidden` or be placed under other elements due to `z-index`. Furthermore, it can affect `:nth-child` selectors and some flex layouts.
142
+
143
+
131
144
### Customizing the drag placeholder
132
145
While a `cdkDrag` element is being dragged, the CDK will create a placeholder element that will
133
146
show where it will be placed when it's dropped. By default the placeholder is a clone of the element
0 commit comments