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): account for out of view container and stacking order #14257

Merged
merged 1 commit into from
Dec 4, 2018

Conversation

crisbeto
Copy link
Member

Currently we use the ClientRect of each drop container to determine whether an item can be dropped into it. Since the ClientRect doesn't know whether the container is scrolled out of the view or is positioned under another element, users can end up accidentally moving items into containers that aren't visible.

These changes rework the logic to look for which containers intersect with the user's pointer, and to filter based on whether the container is the top-most element at the pointer's position.

Fixes #14231.

@crisbeto crisbeto added the target: patch This PR is targeted for the next patch release label Nov 24, 2018
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 24, 2018
@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch from 77d4aed to ffa43db Compare November 24, 2018 14:43
@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch from ffa43db to 948b483 Compare November 24, 2018 15:06
@ngbot
Copy link

ngbot bot commented Nov 27, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

1 similar comment
@ngbot
Copy link

ngbot bot commented Nov 27, 2018

Hi @crisbeto! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch from 948b483 to dcf2ed9 Compare November 27, 2018 17:56
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 pr: lgtm action: merge The PR is ready for merge by the caretaker labels Nov 27, 2018
@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch 2 times, most recently from 89d54b3 to 28041eb Compare November 30, 2018 20:37
@mmalerba
Copy link
Contributor

mmalerba commented Dec 3, 2018

@crisbeto The presubmit for this actually passed, though its failing CI

@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch from 28041eb to c05f16c Compare December 4, 2018 17:59
@crisbeto
Copy link
Member Author

crisbeto commented Dec 4, 2018

The test failures has been sorted out.

Currently we use the `ClientRect` of each drop container to determine whether an item can be dropped into it. Since the `ClientRect` doesn't know whether the container is scrolled out of the view or is positioned under another element, users can end up accidentally moving items into containers that aren't visible.

These changes rework the logic to look for which containers intersect with the user's pointer, and to filter based on whether the container is the top-most element at the pointer's position.

Fixes angular#14231.
@crisbeto crisbeto force-pushed the 14231/drag-drop-out-of-view branch from c05f16c to fd9a09c Compare December 4, 2018 18:37
@mmalerba mmalerba merged commit c5be8d3 into angular:master Dec 4, 2018
josephperrott pushed a commit to josephperrott/components that referenced this pull request Jan 14, 2019

Verified

This commit was signed with the committer’s verified signature.
fpletz Franz Pletz
…ngular#14257)

Currently we use the `ClientRect` of each drop container to determine whether an item can be dropped into it. Since the `ClientRect` doesn't know whether the container is scrolled out of the view or is positioned under another element, users can end up accidentally moving items into containers that aren't visible.

These changes rework the logic to look for which containers intersect with the user's pointer, and to filter based on whether the container is the top-most element at the pointer's position.

Fixes angular#14231.
@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 Sep 10, 2019
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 target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong component fires drop event in Angular Material 7
4 participants