You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my application, I have multiple draggable components and multiple drop targets. Depending on the component being dragged, drop zones are activated. To make this functionality possible I use the
methods of the DragSource interface to add listeners to activate and deactivate drop zones.
When using the default implementation of getDraggableElement, this works as expected.
However, I want the drag action to be only startable from an icon inside the component I would like to be made draggable. This functionality is described in the Vaadin documentation
Like in the example, I override the getDraggableElement method as follows:
@Override
public Element getDraggableElement() {
return icon.getElement();
}
The moment I do this, the Drag Start and Drag End Listeners on the DragSource stop working entirely.
Expected behavior
When overriding the getDraggableElement method in a class that implements the DragSource interface, I expect the Drag Start and Drag End listeners added on the DragSource with the interface provided addDragStartListener and addDragEndListener component to still be called.
Minimal reproducible example
See https://github.com/thomasdewaelheyns/vaadin-drag-drop for an example. In this project, the ContainerLayout uses normal drag and drop without the getDraggableElement override. The WidgetLayout does override to make the icon the draggable element and does not fire the
Versions
Vaadin: 23.4.0
Flow: 23.4.0
and
Vaadin: 24.3.8
Flow: 24.3.7
Java: Eclipse Adoptium 17.0.6
OS: amd64 Windows 10 10.0
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
The text was updated successfully, but these errors were encountered:
Description of the bug
In my application, I have multiple draggable components and multiple drop targets. Depending on the component being dragged, drop zones are activated. To make this functionality possible I use the
methods of the
DragSource
interface to add listeners to activate and deactivate drop zones.When using the default implementation of
getDraggableElement
, this works as expected.However, I want the drag action to be only startable from an icon inside the component I would like to be made draggable. This functionality is described in the Vaadin documentation
Like in the example, I override the
getDraggableElement
method as follows:The moment I do this, the Drag Start and Drag End Listeners on the DragSource stop working entirely.
Expected behavior
When overriding the
getDraggableElement
method in a class that implements theDragSource
interface, I expect the Drag Start and Drag End listeners added on the DragSource with the interface providedaddDragStartListener
andaddDragEndListener
component to still be called.Minimal reproducible example
See https://github.com/thomasdewaelheyns/vaadin-drag-drop for an example. In this project, the ContainerLayout uses normal drag and drop without the
getDraggableElement
override. The WidgetLayout does override to make the icon the draggable element and does not fire theVersions
Vaadin: 23.4.0
Flow: 23.4.0
and
Vaadin: 24.3.8
Flow: 24.3.7
Java: Eclipse Adoptium 17.0.6
OS: amd64 Windows 10 10.0
Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
The text was updated successfully, but these errors were encountered: