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

Keep draging element invisible but positioned on drop position #69

Open
basz opened this issue Sep 2, 2021 · 1 comment
Open

Keep draging element invisible but positioned on drop position #69

basz opened this issue Sep 2, 2021 · 1 comment

Comments

@basz
Copy link

basz commented Sep 2, 2021

The element being dragged is removed from the list until it is dropped. Is it possible to keep the element invisible but positioned? This would prevent lists items from jumping around too much.

@AndrewJo
Copy link

In case anyone else that also came across this, you can always override the CSS:

.dragSortItem.-isDragged {
  /* Or use block or flex or whatever that makes sense to keep displaying it. */
  display: inherit;

  /* Show the element but make it translucent. Set to 0 if you want to make it invisible. */
  opacity: 0.5;
}

/* The following paddings need to be fixed if keeping the dragged element positioned 
   in the list or it would create a massive gap. */
.dragSortItem.-placeholderBefore {
  padding-top: 0;
}

.dragSortItem.-placeholderAfter {
  padding-bottom: 0;
}

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

2 participants