Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on Drag and Drop #38

Open
uok-dev opened this issue Jan 14, 2025 · 0 comments
Open

Error on Drag and Drop #38

uok-dev opened this issue Jan 14, 2025 · 0 comments

Comments

@uok-dev
Copy link

uok-dev commented Jan 14, 2025

on drag and drop error has occured

my code is :
<Vue3TreeVue :items="meta.depts" @onselect="item=>meta.seldept=item" @dropValidator="onBeforeItemDropped">
<template #item-prepend-icon="treeViewItem" >


onBeforeItemDropped =(droppedItem,destinationNode)=>{
console.log("Dropped Item:", droppedItem);
console.log("Destination Node:", destinationNode);
return new Promise((resolve) =>resolve(droppedItem !== destinationNode))
}

the error is :
runtime-core.esm-bundler.js:268 Uncaught TypeError: Converting circular structure to JSON
--> starting at object with constructor 'Object'
| property 'meta' -> object with constructor 'Object'
| property 'parent' -> object with constructor 'Object'
| property 'children' -> object with constructor 'Object'
--- index 0 closes the circle
at JSON.stringify ()

the error thrown code is :
const onDragNode = (item, event) => {
if (item.disableDragAndDrop) return;
if (event.dataTransfer) {
[here is the error]-> event.dataTransfer.setData('text/plain', JSON.stringify(item));
}
};

Please help... thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant