Skip to content

enableMove() removes snapping on existing items #1658

@NealonF

Description

@NealonF

Subject of the issue

When you call enableMove on a drag-disabled grid with existing items, the existing items will have drag unlocked but will not snap into grid cells as normal. Instead they just stay exactly wherever you drag them to. However, if you add a new item to the grid while enableMove is used this way, then the new item will have normal snapping behavior. This is for the JQ version. On the h5 version, the existing items will stay undraggable instead of the floating behavior. The rest of the results seem to be the same as JQ. The difference between versions should probably be verified just to make sure what I found is true.

Your environment

  • JQ 3.2 and JQ 3.3 and h5 3.3
  • Version 88.0.4324.190 (Official Build) (64-bit) and firefox 86 (64 bit)

Steps to reproduce

https://jsfiddle.net/q904xvfu/12/

push add button to add widget.
try dragging and see that it's locked.
press toggle button (confirmed in console output)
(JQ) drag existing widget and see that it does not snap into a cell. (h5) drag existing widget and see that it is still locked
add another widget and drag that one to see that it DOES snap into cell.
can click toggle again to lock the grid, then again to see that the issue applies to all existing items.

Expected behavior

Items should be snapping into cells when dragged, when drag is enabled this way

Actual behavior

on JQ, items wont snap and will float instead. on h5 they stay undraggable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions