Skip to content
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): not transferring input value when cloning element for preview #20009

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

crisbeto
Copy link
Member

We use cloneNode to create a preview for an element which clones all of the attributes of an element, but that may not pick up properties like its value. These changes add some logic where we clone the value with a similar approach that we use for cloning canvas elements. Also generalizes the approach a bit so we don't have to keep repeating the logic.

Fixes #19905.

@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release labels Jul 16, 2020
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Jul 16, 2020
Copy link

@Achilles1515 Achilles1515 left a comment

Choose a reason for hiding this comment

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

This transferData routine is only applied to descendant nodes, but it also should check the top-level node itself (e.g. if a cdkDrag directive is directly placed on a select element).

… preview

We use `cloneNode` to create a preview for an element which clones all of the attributes of an element, but that may not pick up properties like its `value`. These changes add some logic where we clone the value with a similar approach that we use for cloning `canvas` elements. Also generalizes the approach a bit so we don't have to keep repeating the logic.

Fixes angular#19905.
@crisbeto
Copy link
Member Author

Good point. Updated.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels Jul 20, 2020
@wagnermaciel wagnermaciel merged commit d53d5b6 into angular:master Jul 21, 2020
wagnermaciel pushed a commit that referenced this pull request Jul 21, 2020
… preview (#20009)

We use `cloneNode` to create a preview for an element which clones all of the attributes of an element, but that may not pick up properties like its `value`. These changes add some logic where we clone the value with a similar approach that we use for cloning `canvas` elements. Also generalizes the approach a bit so we don't have to keep repeating the logic.

Fixes #19905.

(cherry picked from commit d53d5b6)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Drag and drop select inputs
5 participants