Skip to content

fix(drag-drop): support cdkDropListHasAnchor placeholder styling#2110

Draft
chintankavathia wants to merge 1 commit into
mainfrom
fix/drag-drop/styles/has-anchor
Draft

fix(drag-drop): support cdkDropListHasAnchor placeholder styling#2110
chintankavathia wants to merge 1 commit into
mainfrom
fix/drag-drop/styles/has-anchor

Conversation

@chintankavathia
Copy link
Copy Markdown
Member

@chintankavathia chintankavathia commented May 29, 2026

Adjust drag placeholder styles so that drop lists using cdkDropListHasAnchor keep the original item visible as an anchor in the source list while still hiding the placeholder in plain drop lists. Also make the anchor clone always render like the original item.

Related to #2106


Documentation.
Examples.
Dashboards Demo.
Playwright report.

Coverage Reports:

Code Coverage

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new drag-and-drop copy example for the tree view component, including the necessary SCSS style updates to support the cdkDropListHasAnchor feature. Feedback on the changes highlights a missing [cdkDragData] input in the site configuration tree template that would lead to a runtime error, as well as a redundant min-block-size property definition in the tree view item styles.

Comment thread src/app/examples/si-tree-view/si-tree-view-drag-drop-copy.html
Adjust drag placeholder styles so that drop lists using
`cdkDropListHasAnchor` keep the original item visible as an anchor in
the source list while still hiding the placeholder in plain drop lists.
Also make the anchor clone always render like the original item.
@TaylorShane
Copy link
Copy Markdown

TaylorShane commented May 29, 2026

With the current implementation, a drag to another tree that doesn't accept a drop can cause unintended re-ordering/sorting behavior. It would be good to document that adding [cdkDropListSortingDisabled]="true" to the source tree can avoid this behavior if the consumer desires.

And, this approach removes the source item from the tree when the drag is initiated which is confusing for the user.

copy-confused-with-sorting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants