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

How to delete a linked node? #592

Open
wf08314110101 opened this issue Dec 14, 2023 · 3 comments
Open

How to delete a linked node? #592

wf08314110101 opened this issue Dec 14, 2023 · 3 comments

Comments

@wf08314110101
Copy link

Describe the bug
craft json:
{
"ROOT": {
"type": {
"resolvedName": "PageContainer"
},
"isCanvas": true,
"props": {
},
"displayName": "APP",
"hidden": false,
"nodes": [
"dseJuw_N09"
],
"linkedNodes": {}
},
"dseJuw_N09": {
"type": {
"resolvedName": "TabsWrapper"
},
"isCanvas": false,
"props": {
},
"displayName": "Tabs",
"custom": {},
"parent": "ROOT",
"hidden": false,
"nodes": [],
"linkedNodes": {
"simple-tabpanel-0": "4UMnl2CvbA",
"simple-tabpanel-1": "7nsOGA7ixG",
"simple-tabpanel-2": "OQA1r8DNvq"
}
},
"4UMnl2CvbA": {
"type": {
"resolvedName": "Container"
},
"isCanvas": true,
"props": {
},
"displayName": "Container",
"custom": {},
"parent": "dseJuw_N09",
"hidden": false,
"nodes": [],
"linkedNodes": {}
},
"7nsOGA7ixG": {
"type": {
"resolvedName": "Container"
},
"isCanvas": true,
"props": {
},
"displayName": "Container",
"custom": {},
"parent": "dseJuw_N09",
"hidden": true,
"nodes": [],
"linkedNodes": {}
},
"OQA1r8DNvq": {
"type": {
"resolvedName": "Container"
},
"isCanvas": true,
"props": {
},
"displayName": "Container",
"custom": {},
"parent": "dseJuw_N09",
"hidden": true,
"nodes": [],
"linkedNodes": {}
}
}

To Reproduce
Steps to reproduce the behavior:

const { actions } = useEditor()
actions.delete("OQA1r8DNvq")

Error: Invariant failed: Attempting to delete a top-level Node

Expected behavior

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Your environment

Software Version(s)
craft.js
React
TypeScript
Browser
npm/Yarn
Operating System
@wf08314110101 wf08314110101 changed the title How tp delete a linked node? How to delete a linked node? Dec 14, 2023
@jorgegonzalez
Copy link

Same issue.

@jorgegonzalez
Copy link

@prevwong is deleting linked nodes possible?

@raghuwarWeb
Copy link

Yes, same issue here.

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

3 participants