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
Right now the functionality of {{draggable-group}} and {{droppable-group}} are pretty bare-bones. They are good building blocks for more complex functionality, but on their own, they don't do much more than emitting the basic events when items are dragged and dropped.
One thing we can do to increase their usefulness is when events are emitted, instead of only sending an argument with the raw event to the action, also send along an optional "model" that is associated with the item that was dragged, dropped, etc.
For example:
<DroppableGroup
@droppableActions={{hashdropped=(action"droppableDropped")
}}
as |Group|
>
<Group.container as |Container|>
<Container.dropzone as |Dropzone|}}
<Dropzone.item @item={{item}}>{{item.name}}</Dropzone.item>
</Container.dropzone>
<Container.dropzone as |Dropzone|></Container.dropzone>
</Group.container>
<DroppableGroup>
actions: {droppableDropped(event,item){console.log(`The item/model that was dropped was ${item.name}`);}}
The text was updated successfully, but these errors were encountered:
Right now the functionality of
{{draggable-group}}
and{{droppable-group}}
are pretty bare-bones. They are good building blocks for more complex functionality, but on their own, they don't do much more than emitting the basic events when items are dragged and dropped.One thing we can do to increase their usefulness is when events are emitted, instead of only sending an argument with the raw event to the action, also send along an optional "model" that is associated with the item that was dragged, dropped, etc.
For example:
The text was updated successfully, but these errors were encountered: