Skip to content

DragOverEvent

Routed event probing candidate drop zones beneath the pointer during drag movement and animation ticks.

Overview

DragOverEvent is dispatched continuously as the pointer hovers over candidate drop widgets.

Target Validation

Drop zones inspect payload() and confirm acceptance by calling event.accept(this):

widget.addListener(DragOverEvent.class, event -> {
    if (event.payload().matchesType("inventory/*")) {
        event.accept(widget);
    }
});

When accepted, the widget becomes session.dropTarget(), enabling visual hover styling and indicator lines.

  • DragSession: Live state and controller of an active drag gesture, managing pointer coordinates, active drop target, ghost positioning, insertion indicators, and autoscrolling.
  • DropController: Drop target controller attachable to any widget via composition to filter payloads and handle drag enter, over, leave, and drop events.

API

DragOverEvent::accept(Widget)

Designates the specified widget as the active drop target and stops further event bubbling.

Parameter Type Description
zone Widget Widget claiming drop target acceptance.