Skip to content

Commit b8b0c52

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
1 parent 27d1023 commit b8b0c52

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
@@ -467,8 +467,8 @@ $.widget("ui.sortable", $.ui.mouse, {
467467

468468
_intersectsWithPointer: function(item) {
469469

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

0 commit comments

Comments
 (0)