-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(drag-drop): drop-list wrong enter position #19116
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): drop-list wrong enter position #19116
Conversation
Parent rect should be cached again when the new item has been added. If item is entering from start (left/top) it should be inserted in the first position. When looking for item index from pointer position exclude right/bottom pixel: that pixel is external.
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.
The changes mostly LGTM, but it needs unit tests.
Added unit tests to cover fixed scenarios
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, thank you for the contribution. This is something that has been nagging me, but I haven't had the time to look into it properly 👍 .
* fix(drag-drop): drop-list wrong enter position Parent rect should be cached again when the new item has been added. If item is entering from start (left/top) it should be inserted in the first position. When looking for item index from pointer position exclude right/bottom pixel: that pixel is external. * Corrected a bug when entering with no active draggables. * Corrected enter behavior on reversed container Added unit tests to cover fixed scenarios * Fixed view-engine broken test
…ntermediate child In angular#19116 some logic was added so that we use `insertBefore` when an item is entering from the top, rather than `appendChild`. The problem is that an error will be thrown if the first item in the drop list isn't a sibling of the first draggable element. Fixes angular#19359.
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. |
Parent rect should be cached again when the new item has been added.

If item is entering from start (left/top) it should be inserted in the first position from the beginning to avoid "jump effect"

When looking for item index from pointer position exclude right/bottom pixel: that pixel is external.
