Skip to content

Is it possible to drag&drop sl-tree-items within the tree ? #1405

Answered by claviska
XorTdsc asked this question in Help
Discussion options

You must be logged in to vote

I'm not sure what syntax these handlers are supposed to be:

<sl-tree>
  <sl-tree-item
                draggable="true"
                (ondragstart)="console.log('ondragstart')"
                (ondragover)="console.log('ondragover')"
                (ondrop)="console.log('ondrop')">
    Item 1
  </sl-tree-item>
  <sl-tree-item
                draggable="true"
                (ondragstart)="console.log('ondragstart')"
                (ondragover)="console.log('ondragover')"
                (ondrop)="console.log('ondrop')">
    Item 2
  </sl-tree-item>
</sl-tree>

But adding the listeners like this will log them to the console.

const items = document.querySelectorAll('sl-tree-item');

items.f…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@XorTdsc
Comment options

@claviska
Comment options

Answer selected by XorTdsc
@XorTdsc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants