bug(cdk/drag-drop): Improper positioning of drag preview since it uses native popover (v17.3.6 and above) #29809
Labels
area: cdk/drag-drop
P3
An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Is this a regression?
The previous version in which this bug was not present was
17.3.5
Description
A specific combination of an already existing CSS declaration on a
cdkDrag
element causes the position of the drag preview element to be incorrect because the resulting CSS is no longer identical to how it was prior to using the native popoper (so prior to version 17.3.6).The exact cause is the addition of user agent styling that was not applied before, namely:
inset: 0px;
(using Chrome)In addition to the properties
top
andleft
(which are always set to 0 anyway),bottom
andright
are now also set to 0 by the UA styles being applied now.This CSS rule should be extended I think (with
inset: unset;
).Reproduction
StackBlitz link: https://stackblitz.com/edit/jn6uje?file=src%2Fexample%2Fcdk-drag-drop-sorting-example.css
Steps to reproduce:
align-self: center;
affects the position of the drag preview.Expected Behavior
Using
align-self: center
on thecdkDrag
element (.example-box) should not affect the position of the drag preview. The position should be exactly the same as when this CSS declaration is not used. In other words, there should be no difference in the final result compared to whencdk/drag-drop
did not use popoper under the hood for the preview.Actual Behavior
The element is centered vertically between top and bottom (if you do not consider the transform).
The combination of CSS below results in this particular issue (only properties included that really lead to this particular behavior):
Environment
The text was updated successfully, but these errors were encountered: