Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

packery draggabilly: prevent from dropping over a .stamp.non-drop item. #561

Open
jayenne opened this issue Nov 16, 2021 · 2 comments
Open

Comments

@jayenne
Copy link

jayenne commented Nov 16, 2021

I have a case where I'd like to force an element to always be the first* item where it can not move or be dropped over.

I have tried with stamp but can still drag'n'drop over the stamped item. ideally, it may be nice if 'stamp' could have a non-drop option which prevents any item being dragged fro mdropping over it (on drop, it would revert back to the position from where it was picked up). Whilst draggon over an "non-movable stamped item" the item being dragged would have a class classed that may be styled to visually indicate to the user that this item is within a non-drop zone.

thanks in advance,

@jayenne jayenne changed the title packery draggabilly imovable element. packery draggabilly: prevent from dropping over a .stamp.non-drop item. Nov 16, 2021
@rawthriver
Copy link

rawthriver commented Dec 8, 2021

+1
The workaround is to perform layout in dragItemPositioned event if order was not changed, for example:

container.on('dragItemPositioned', function() {
  if (!orderChanged()) {
    setTimeout(function() {
      container.packery('layout');
    }, 16);
    return;
  }
  saveOrder();
});

@rawthriver
Copy link

Using this in addition solves the problem, but I would like some standard solution
desandro/draggabilly#177

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants