BUG: Set root does not work
See original GitHub issueGrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Safari 15.0
Reproducible demo link
https://jsfiddle.net/adw6y12f/9/
Describe the bug
Hello, I’m trying to set root component for the editor as it was described here. Unfortunately, this is not working and I can edit all HTML content.
Thanks for your advice or fix that bug 😃
How to reproduce the bug?
- Create HTML with some divs
- Set
id
orclass
to one div that you wants to be root layer - Set that
id
as root element toinit
method :
grapesjs.init({
container: '#gjs',
fromElement: 1,
height: '100%',
storageManager: { type: 0 },
plugins: ['gjs-blocks-basic'],
layerManager: {
root: '#editable',
},
});
- You can edit all elements in editor
What is the expected behavior? All elements will be rendered, but only elements in root element will be editable
What is the current behavior? All elements are editable
Code of Conduct
- I agree to follow this project’s Code of Conduct
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
[Guide] Post-Root Common Issues, Bugs, and Fixes
This guide is meant to help those who have rooted their phones and are now finding it slow, laggy, messy, etc.
Read more >How to Fix Root Bug after macOS 10.14 Update
There are many tricks to fix root bug on macOS 10.14 update. Here will offer you the most effective solutions to fix macOS...
Read more >Bug #1980466 “mysql_secure_installation can not set root ...
When I am trying to use mysql_secure_installation after I installed MySQL server, it ends up with loop asking me the new root password....
Read more >ADB root is not working on emulator (cannot run as root in ...
3, now I cannot run adb root command for new created emulator. the error shown is below: adbd cannot run as root in...
Read more >"error: XDG_RUNTIME_DIR not set in the environment." when ...
(nautilus:9341): Gtk-WARNING **: cannot open display: The issue does not occur when I attempt to run nautilus as non-root. I am using ubuntu...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yeah, the LayerManager module itself has no documentation. Indeed it’s on the waiting list for the refactoring and once it’s done we can publish more about its usage and API documentation.
Anyway, I’ve seen your previous message about how you would like to use my demo example but with inverted logic (enabling only what is known). Well, I’ve tried it but unfortunately, I’ve spotted some issues I have to fix before. Once the next release is ready, I’ll publish the demo example.
In that case,
onlyMatched: true
might help you, but consider that you’re always able to filter CSS rules before exporting them so you can exclude what is not necessary for your output.