Opened 7 years ago
Last modified 7 years ago
#14912 open feature
Draggable: Allow setting containment during drag
Reported by: | Mrten | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.draggable | Version: | 1.11.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
If you set a containment in the start event instead of in the default options, like this:
https://jsfiddle.net/8wzdt8z5/8/
the intended containment between cell 2 and 4 only works the second time you drag cell 3.
If you add an (obvious internal) call to _setContainment it works the first time (see fiddle).
Change History (3)
comment:1 Changed 7 years ago by
comment:2 Changed 7 years ago by
Summary: | Setting containment in start works only the second time → Draggable: Allow setting containment in the start event |
---|---|
Type: | bug → feature |
It's not that this works the second time, it's that the call from the first time has been applied.
This option is not meant to be updated during a drag. I'm not sure if we want to add support for this either. We'll have to discuss this within the team.
In the meantime, you can accomplish this with a custom containment via the drag
event. See https://jsfiddle.net/8wzdt8z5/9/
comment:3 Changed 7 years ago by
Status: | new → open |
---|---|
Summary: | Draggable: Allow setting containment in the start event → Draggable: Allow setting containment during drag |
We're tentatively accepting this feature for the rewrite. However, the proposed patch is too limited since it only supports one specific time that the option can be changed. A proper implementation would handle changes to containment
at any point.
An obvious fix for this is: