Skip to content

Commit 81835fa

Browse files
Jason Moonscottgonzalez
authored andcommitted
Sortable: update placeholder when axis is x or y. Fixed #8274 - placeholder doesn't move when dragging outside of container element
(cherry picked from commit b8b0c52)
1 parent f0c3cf6 commit 81835fa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ui/jquery.ui.sortable.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,8 @@ $.widget("ui.sortable", $.ui.mouse, {
468468

469469
_intersectsWithPointer: function(item) {
470470

471-
var isOverElementHeight = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
472-
isOverElementWidth = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
471+
var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
472+
isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
473473
isOverElement = isOverElementHeight && isOverElementWidth,
474474
verticalDirection = this._getDragVerticalDirection(),
475475
horizontalDirection = this._getDragHorizontalDirection();

0 commit comments

Comments
 (0)