dropAcceptor

var dropAcceptor: (DragEvent) -> Boolean? = null

Returns whether this ComponentView is a valid drop target for the dragged component in the given DragEvent or not.

Implement this function in such a way that it returns true if this ComponentView accepts the drop of the given DropEvent.draggedComponent or false if a drop is not valid. The DropEvent.draggedComponent will snap back if all available drop targets return false.

It is advised not to modify the Scene or its children in this function. A better suited function to modify the Scene or its children after a drag and drop gesture is onDragDropped .

Note: onDragDropped only gets invoked if the dropAcceptor returns true for the given DropEvent.

See also