Skip to content

Re-trigger put check based on condition/modifier #1838

Open
@OkanEsen

Description

@OkanEsen

Right now, I'm using the put option inside groups to refuse some items based on dynamic rules, which can be ignored if the user holds the Ctrl key.

The problem is, when the user stops holding the Ctrl key, without initiating the drop, the put rules don't apply any more and the item can then be dropped, even though it would've been blocked based on the put rules. I know that "put" behaves correctly in that case, since holding the Ctrl key returned true for that specific list and rerunning the put rules wouldn't make sense any more.

Is there a way, where I can re-trigger the put rules? I already tried to toggle the disabled state for the active sortable instance but this doesn't seem to work. I also tried to move the ghost element back to the previous parent but this didn't work either.


Demo: https://jsbin.com/vokuwuboca/edit?js,output

Steps:

  1. Chose item from first list
  2. Hold Ctrl key
  3. Start dragging to second list
    => Not possible, which is expected
  4. Release Ctrl key
    => Possible, also expected
  5. Now hold Ctrl key again
    => Shouldn't be possible anymore based put rules
    => Expectation: Ghost element is reverted to previous parent -> drop not possible.

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