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

[bug] Prevent deleting core elements #851

Open
Kitenite opened this issue Dec 5, 2024 · 4 comments · May be fixed by #917
Open

[bug] Prevent deleting core elements #851

Kitenite opened this issue Dec 5, 2024 · 4 comments · May be fixed by #917
Labels
bug Something isn't working

Comments

@Kitenite
Copy link
Contributor

Kitenite commented Dec 5, 2024

Describe the bug

There's been instances of people playing around and deleting core elements like body tags or core div tag. Then surprise pikachu face when the whole page stops working.

This is a failure of communication on our part. We should add guard rails for core elements. Some cases may be:

  1. body tag
  2. top level div tag in a template.
  3. Perhaps anything following a return statement should not be deleted.

See this great work on preventing deleting array elements by @iNerdStack for inspiration #786

@Kitenite Kitenite added the bug Something isn't working label Dec 5, 2024
@iNerdStack
Copy link
Contributor

@Kitenite
This could introduce a "lock element" feature. Some elements can be flagged as locked, so they can't be deleted or moved.
We will lock the core elements by default, while the user can toggle lock in the layer panel for other none core elements.
What do you think?

@Kitenite
Copy link
Contributor Author

Kitenite commented Dec 7, 2024

@iNerdStack , I think it's more so that users don't know what they should not be deleting. Perhaps we can prevent deletion if the element's parent is NOT another jsx element?

@iNerdStack
Copy link
Contributor

Oh, thats clearer now. yes that should work

@iNerdStack iNerdStack linked a pull request Dec 19, 2024 that will close this issue
6 tasks
@drfarrell drfarrell linked a pull request Dec 19, 2024 that will close this issue
6 tasks
@drfarrell
Copy link
Collaborator

@Kitenite this was merged in yea? can we close this out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants