Skip to content

Containment cannot be set #720

@ZoolWay

Description

@ZoolWay

Is is not possible to limit move/size operations with the jQuery-UI plugin with the containment setting. Also there is the option draggable to override jQuery-UI parameters for this it will ignore the parameter containment. If you look at issue #695 or gridstack.jQueryUI.js:69 you can see that containment is set by GridStack nevertheless.

I tried changing it to

containment: this.grid.opts.isNested ? this.grid.container.parent() : (this.grid.opts.draggable || null),

to let it override whenever possible. In theory this works, in praxis this leads to a bunch of other problems when it utilizes jQuery.

An example what I am trying to achieve can be seen here:
https://jqueryui.com/draggable/#constrain-movement

At the moment whenever I drag an element outside of the grid things just go crazy, items get moved anywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions