ember-drag-sort icon indicating copy to clipboard operation
ember-drag-sort copied to clipboard

Keep draging element invisible but positioned on drop position

Open basz opened this issue 4 years ago • 1 comments

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.

basz avatar Sep 02 '21 09:09 basz

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;
}

AndrewJo avatar Oct 25 '22 18:10 AndrewJo