Skip to content

Commit

Permalink
* sortable: fix empty dragging shadow style.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jun 19, 2024
1 parent e0df9a5 commit b929568
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/sortable/src/style/sortable-list.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
.sortable-list .sortable-ghost > .listitem {
@apply -bg-warning-50;
}
.sortable-empty-shadow {
@apply !-opacity-0 !-absolute !-pointer-events-none !-left-0 !-top-0 !-w-px !-h-px;
}
2 changes: 1 addition & 1 deletion lib/sortable/src/vanilla/sortable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class Sortable extends Component<SortableOptions> {
options.setData = ((dataTransfer, dragEl) => {
if (dragShadow === false && !this._emptyShadow) {
this._emptyShadow = dragEl.cloneNode(true) as HTMLElement;
this._emptyShadow.style.opacity = '0!important';
this._emptyShadow.classList.add('sortable-empty-shadow');
document.body.appendChild(this._emptyShadow);
}
dataTransfer.setDragImage(dragShadow === false ? this._emptyShadow! : dragShadow, 0, 0);
Expand Down

0 comments on commit b929568

Please sign in to comment.