Skip to content

Commit 07ce771

Browse files
zhizhangchenmikesherov
authored andcommitted
Sortable: Skip triggering over event if it's alreay over the continer. Fixes #9041: the over event fires on every pixel movement
1 parent 89473f6 commit 07ce771

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ui/jquery.ui.sortable.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -842,8 +842,10 @@ $.widget("ui.sortable", $.ui.mouse, {
842842

843843
// move the item into the container if it's not there already
844844
if(this.containers.length === 1) {
845-
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
846-
this.containers[innermostIndex].containerCache.over = 1;
845+
if (!this.containers[innermostIndex].containerCache.over) {
846+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
847+
this.containers[innermostIndex].containerCache.over = 1;
848+
}
847849
} else {
848850

849851
//When entering a new container, we will find the item with the least distance and append our item near it

0 commit comments

Comments
 (0)