BUG: CSS added via custom code persists after custom code component is removed
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
any
Reproducible demo link
Describe the bug
How to reproduce the bug?
- Add custom code component with HTML + CSS
- Delete custom code component.
What is the expected behavior? All code should be removed, including CSS
What is the current behavior? custom CSS is not being removed, though the rest is.
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (3)
This is not related to the core and should be addressed at the plugin level. Please create the issue there and we'll try to figure out the right approach.
@stpp2 This is not really a bug; it's more of a feature. :)
Try using clearStyles:
Yeah clearStyles is already enabled in my case, but that doesn't seem to work well in many cases.
Either way I'd expect the Custom Code component to be somewhat "containerized" so it's not leaving anything in the doc when removed.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6683
BUG: Modals close on mouseup event outside of modal rather than a full click
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 143.0.7499.169 Reproducible demo li...
Issue #5378
BUG: Uncaught TypeError: Cannot read properties of undefined (reading 'Canvas') while dragging a component in Layer Manager Panel
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v116.0.5845.97 Reproducible demo li...
Issue #4257
BUG: Background modification doesn't work for non-images
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v100 Reproducible demo link https:/...
Issue #4000
BUG: Pasting a component in root body layer throws TypeError
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v89 Reproducible demo link https://...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.