Skip to content

Changing order of nodes #63

@lavrton

Description

@lavrton

I made this demo: https://codesandbox.io/s/festive-germain-1js7yj?file=/App.svelte

In the demo, I am rendering stars from an array. Also I am changing order of stars, to display dragged start on top:

let handleDragStart = e => {
	// save drag element:
	dragItemId = e.detail.target.id();
	// move current element to the top:
	const item = list.find(i => i.id === dragItemId);
	const index = list.indexOf(item);
	list.splice(index, 1);
	list.push(item);
};

But I don't see that on canvas. Does the library support that? Or I am doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions