use fission::prelude::*;
fission_component! {
pub BoardColumnDropTarget<()> {
props {
column_id: String,
accept_card: ActionEnvelope,
}
}
view(target, _state, cx) =>
DragTarget(
id: WidgetId::explicit(&format!("board.column.{}", target.column_id)),
semantics_identifier: Some(format!("board.column.{}", target.column_id)),
child: Text(cx.tr("board.drop_to_move")),
hover_child: Text(cx.tr("board.release_to_move")),
on_drop: target.accept_card.clone(),
)
}
Field | Type | Meaning | Notes / default behavior |
|---|---|---|---|
id | Option<WidgetId> | Stable identity for the drop target. | Use explicit IDs for repeated or dynamic targets. |
semantics_identifier | Option<String> | Stable semantic/test identifier. | Lets tests target this drop surface without coordinates. |
child | Widget | The visible drop target surface. | Required. |
hover_child | Option<Widget> | Alternate surface while this target is hovered by a drag. | Defaults to None, so child remains visible. |
on_drop | Option<ActionEnvelope> | Action dispatched when the runtime delivers a drop to this target. | Defaults to None. Read payloads from ReducerContext::input. |