Skip to content

Commit 86308da

Browse files
committed
fix(sortable): fire hover when moving from spill BACK to same position
(ie listId different or index different, but data.id same)
1 parent 2d9516b commit 86308da

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/sortable/src/directives/render.directive.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,20 +50,20 @@ export class SkyhookSortableRenderer<Data> implements OnInit, OnDestroy {
5050
private subs = new Subscription();
5151

5252
/** This DropTarget is attached where [ssRender] is.
53-
*
53+
*
5454
* It is responsible for triggering {@link SortableSpec.hover} when the place you are hovering changes.
5555
*/
5656
target: DropTarget<DraggedItem<Data>>;
5757

5858
/** This DragSource is NOT attached for you.
59-
*
59+
*
6060
* You need to attach it yourself, by pulling #render="ssRender", and applying [dragSource]="render.source".
6161
*/
6262
source: DragSource<DraggedItem<Data>>;
6363

6464
/**
6565
* Shortcut for `this.source.listen(m => m.isDragging())`
66-
*
66+
*
6767
*/
6868
isDragging$: Observable<boolean>;
6969

@@ -172,7 +172,7 @@ export class SkyhookSortableRenderer<Data> implements OnInit, OnDestroy {
172172
/** @ignore */
173173
private hover(item: DraggedItem<Data>, clientOffset: Offset): void {
174174
// hovering on yourself should do nothing
175-
if (this.isDragging(item)) {
175+
if (this.isDragging(item) && this.index === item.hover.index && this.listId === item.hover.listId) {
176176
return;
177177
}
178178
const size = this.size();

0 commit comments

Comments
 (0)