Skip to main content

SelectableDraggable

Function SelectableDraggable 

Source
pub fn SelectableDraggable<K: Clone + PartialEq + 'static>(
    _: SelectableDraggableProps<K>,
) -> Element
Expand description

A draggable list/grid item participating in a selection.

  • Click / Ctrl+click manage the selection (via Selection::click).
  • Dragging a selected item picks up the whole selection; dragging an unselected one picks up just that item (and selects it).
  • Works with mouse, touch, pen and keyboard (wraps PointerDraggable).
  • The wrapper exposes data-selected="true" for styling.

Requires a DndProvider::<Vec<K>> ancestor.

§Props

For details, see the props struct definition.

  • item : K

    This item’s key.

  • selection : Selection<K>

    Shared selection state from use_selection.

  • zone : Option<ZoneId>

    The zone this item lives in.

  • effect : DropEffect

    Drop effect. Defaults to Move.

  • label : Option<String>

    Label for screen-reader announcements.

  • attributes : Vec<Attribute>
  • children : Element