Vaadin 8.1 DnD: There should be method "setDragImage(Component dragImageComponent)"
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1.8k
- Forks
- 717
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 3
Description
Similar to the deprecated DragAndDropWrapper.setDragImageComponent(), there should be a method for the DragSourceExtension which allows us to set a custom component as the drag image. Mozilla clearly states, that
If the node is an HTML img element, an HTML canvas element or a XUL image element, the image data is used. Otherwise, image should be a visible node and the drag image will be created from this. If image is null, any custom drag image is cleared and the default is used instead.
This appears to be easily achieved in JS with dragStartEvent.dataTransfer.setDragImage(componentId, 0, 0);, given that the component has a distinct ID.
And yes, this feature won't work in IE11.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with DragSourceExtension and the deprecated DragAndDropWrapper.setDragImageComponent() API, then inspect the dragStartEvent dataTransfer path described in the issue. Done means a custom component can be supplied as the drag image, null restores the default, and the behavior is covered where the existing drag-and-drop functionality is tested.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, javascript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100