-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(drag-drop): avoid generating elements with duplicate ids #13489
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/** Creates a deep clone of an element. */ | ||
function deepCloneNode(node: HTMLElement): HTMLElement { | ||
const clone = node.cloneNode(true) as HTMLElement; | ||
// Remove the `id` to avoid having multiple elements with the same id on the page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could this cause issues if the element is styled based on the id
?
Should we at least document this in the md
file for dragdrop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a note about it, but we've been doing this in the MatIconRegistry
for a long time now and it hasn't come up.
0a5edb5
to
0816d8e
Compare
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
0816d8e
to
9311f64
Compare
9311f64
to
8149766
Compare
If the consumer hasn't passed in a custom drag placeholder or preview, we clone the element that is being dragged. This can cause the DOM to have multiple elements with the same id.
If the consumer hasn't passed in a custom drag placeholder or preview, we clone the element that is being dragged. This can cause the DOM to have multiple elements with the same id.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
If the consumer hasn't passed in a custom drag placeholder or preview, we clone the element that is being dragged. This can cause the DOM to have multiple elements with the same id.