Specifying background-size in background's properties breaks grapesjs
Ok, I think I found where is the issue, I'll fix it for the next release
Read full answer below βQuestion
Using latest versions of grapesjs (0.14.55) and grapesjs-preset-webpage (0.1.10), I have configured my editor as such:
import grapesjs from 'grapesjs';
import grapesJsPresetWebpage from 'grapesjs-preset-webpage';
grapesjs.init({
// ...
plugins: [grapesJsPresetWebpage],
pluginsOpts: {
[grapesJsPresetWebpage]: {
customStyleManager: [
{
id: 'deco',
name: 'Decorations',
open: false,
buildProps: ['background'],
properties: [
{
name: 'Background',
property: 'background',
properties: [{
name: 'Background size',
property: 'background-size'
}
]
}
]
}
]
}
}
});
The library crashes with a "TypeError: values[0] is undefined" error, as referenced in this issue.
If I add all the other properties in the array, such as:
{
property: 'background',
properties: [
{ name: 'Image', property: 'background-image'},
{ name: 'Repeat', property: 'background-repeat'},
{ name: 'Position', property: 'background-position'},
{ name: 'Attachment', property: 'background-attachment'},
{ name: 'Size', property: 'background-size'}
],
}
the error disappears, but I don't need all of those properties...
Answers (3)
Ok, I think I found where is the issue, I'll fix it for the next release
Can confirm it's fixed on v0.14.57. Thanks @artf !
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1985
[BUG] Autosave with remote storage doesn't send network requests
OS: Windows 10 Browser: Chrome 73 GrapesJS version: 0.14.57 I have remote storage configured using this call to grapesjs.init(): While I se...
Issue #1411
Manual triggering of the asset manager rendering is required after opening the AM pop-up
Questions Q: Are you using the latest release (older versions are NOT supported)? A: Yes Q. Are you facing the bug with your local copy of...
Issue #552
Can't reset body background
I've found this here #351 but seems not to reset the body background... Any other way to do this?
Issue #542
Calling render() on PanelManager breaks style manager
In lieu of #540, I'm trying to manually remove a button from the options panel, with this: This works ok, the button goes away, but the pnm...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins βPremium plugins ship with support, regular updates, and production-ready features β save days of integration work.
Browse premium plugins βRelated tutorials
In-depth guides on the same topic.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Tutorial
GrapesJS Inline RTE Plugins Update: CKEditor 5 v0.1.4 and Froala Inline Text Editor
CKEditor 5 Inline for GrapesJS v0.1.4 fixes Studio SDK toolbar clipping, iframe injection and link balloon bugs. Compare with Froala Inline β both $69.
Tutorial
Embed GrapesJS in Your SaaS: A Weekend Guide
Embed GrapesJS in your SaaS and ship a white-label page builder over a weekend. Honest tradeoffs, real code, and the plugins that close the UX gap.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.