Skip to content

1.13.0 bug in sortable, draggable: freezes page, "this.dragDirection" is undefined #1997

@danbernier

Description

@danbernier

Upgrading jquery-ui from 1.12.1 to 1.13.0 seems to have introduced an exception coming from sortable.

jQuery: 3.6.0
jquery-ui: 1.13.0 (not present in 1.12.1)

When you first drag a sortable component, the page freezes, and this error appears in the console:

Uncaught TypeError: Cannot read properties of undefined (reading 'vertical')
    at $.<computed>.<computed>._intersectsWithPointer (sortable.js:595)
    at $.<computed>.<computed>.<anonymous> (widget.js:123)
    at $.<computed>.<computed>._intersectsWithPointer (widget.js:123)
    at $.<computed>.<computed>._mouseDrag (jquery.mjs.nestedSortable.js:203)
    at $.<computed>.<computed>._mouseDrag (widget.js:123)
    at $.<computed>.<computed>._mouseStart (sortable.js:316)
    at $.<computed>.<computed>.<anonymous> (widget.js:123)
    at $.<computed>.<computed>._mouseStart (widget.js:123)
    at $.<computed>.<computed>._mouseMove (mouse.js:150)
    at $.<computed>.<computed>.<anonymous> (widget.js:123)

It looks to come from this line in sortable.js, while evaluating this.dragDirection.vertical.

The only recent commit to sortable.js is 70dae67, but the file history shows a few other commits that I think were added after 1.12.1, so that may be misleading.

This seems to have a lot in common with issue #1991, though I suspect they're distinct.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions