[MGNLUI-3835] Provide a way to disable drag and drop Created: 31/Mar/16 Updated: 21/Sep/17 Resolved: 30/Aug/16 |
|
| Status: | Closed |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 5.3.16, 5.4.9, 5.5 |
| Type: | Improvement | Priority: | Major |
| Reporter: | Thim Anneessens | Assignee: | Oanh Thai Hoang |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | devwl, support | ||
| Remaining Estimate: | 0d | ||
| Time Spent: | 1.75d | ||
| Original Estimate: | 4d | ||
| Issue Links: |
|
||||||||
| Template: |
|
||||||||
| Acceptance criteria: |
Empty
|
||||||||
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
||||||||
| Release notes required: |
Yes
|
||||||||
| Documentation update required: |
Yes
|
||||||||
| Date of First Response: | |||||||||
| Sprint: | Saigon 59 | ||||||||
| Story Points: | 5 | ||||||||
| Description |
|
It often happen that the drag and drop is accidentally triggered where it is not meant to be there.
An example where we don't want drag and drop is the configuration. |
| Comments |
| Comment by Zdenek Skodik [ 27/May/16 ] |
|
dropConstraintClass property of workbench definition is supposed to be optional, but removing the property results in NPE while using the move action and there is nothing like an inverted AlwaysTrueDropConstraint one could configure to disable D&D. |
| Comment by Thim Anneessens [ 27/May/16 ] |
|
As I understand the dropConstraintClass is there to apply constraints when moving. So it is normal that it applies to both Move and D&D. To disable D&D we need another property (like dragAndDropEnabled). We need an extra dragAndDropEnabled property to only disable drag and drop. |
| Comment by Thim Anneessens [ 27/May/16 ] |
|
Ok I found a workarround, This is a hack, it works because it does and because it should not. For some reason only the Drag and Drop calls allowedToMove and the Move does not. So by always returning false there (and not elsewhere) it works. But this is really a stop gap until there is a proper way to do this using magnolia, so the issue is not closed Here is the code public class NoDragAndDropDopConstraint extends NodesAndPropsDropConstraint { @Override } |
| Comment by Mikaël Geljić [ 22/Aug/16 ] |
|
Two things to do here:
|
| Comment by Oanh Thai Hoang [ 26/Aug/16 ] |
|
documentation update,
|