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

Use Original Element for Ghost #41

Open
zerosym opened this issue Sep 21, 2018 · 1 comment
Open

Use Original Element for Ghost #41

zerosym opened this issue Sep 21, 2018 · 1 comment

Comments

@zerosym
Copy link

zerosym commented Sep 21, 2018

Currently the ghost is cloned from the dragged item, and the original is left in place with visibility:hidden applied. The ghost is then appended to the container.

There are a few issues with this that I've come across:

  • Jank when ghost is cloned from an element with a lot of child nodes. Honestly, not sure how much not cloning and using original would improve this.
  • Cloned ghost does not respect the scroll position of nested content. In these situations the drag becomes a bit jarring to look at.
  • Having the ghost inserted into the container as the last element makes for more annoying CSS selectors, since you can no longer use :last-child.

A look at how Trello handles it... they leave behind a simple div placeholder and move the original item out of the container into an upper level body div.

@zerosym
Copy link
Author

zerosym commented Sep 22, 2018

Just a quick demo of the scroll issue.

https://codesandbox.io/s/pkx885prpx

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

No branches or pull requests

1 participant