[BUG / QUESTION] Deleting default styles does not work
Question
Hello, i'm trying to delete some of the default styles of the blocks. I wrote everything I changed in a plugin.
I used this function to update for example the Text Components style-defaults:
editor.DomComponents.addType(.....)
seen here: https://grapesjs.com/docs/modules/Components.html#update-component-type
Am I getting this wrong?
Also I can't figure out where the style defaults are written, when I change the style-defaults in Text.js for testing, nothing changes in the editor.
Oh and i'm using the mjml-plugin, maybe this issue is wrong here sorry.
Edit: Okay i figured out "style" works but not "style-default":

Is this a bug?
Answers (3)
Hi there! have you tried using setStyle ? cheers.
I'd expect something like this to work (update style-default)
editor.DomComponents.addType('mj-text', {
model: {
defaults: {
'style-default': {
// your new styles...
}
}
}
})
Be sure to load your plugin after the mjml one
Hello @artf, thanks for your reply. this is the exact same code, that i tried out. This one works if I use "style" instead of "style-default".
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3235
BUG: "component:update" does not trigger when components are moved
Taken from https://github.com/artf/grapesjs/blob/dev/src/editor/index.js#L33 component:update - Triggered when a component is updated (move...
Issue #2920
Question: Replace Rich Text Editor with summernote does not seem to work
I am trying to replace the default RTE in grapesjs with summernote. I got some help from the author of summernote and got this codepen to w...
Issue #4294
BUG: Unable to drop textable components into small text areas
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome v100 Reproducible demo link https:/...
Issue #4083
BUG: Set root does not work
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Safari 15.0Reproducible demo link https://js...
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.