StyleManager.addProperty , type: 'select' , Cannot read properties of undefined (reading 'replace')
Question
GrapesJS version
- I confirm to use the latest version of GrapesJS
What browser are you using?
Chrome Version 103.0.5060.53 (Official Build) (x86_64)
Reproducible demo link
private project
Describe the bug
i am trying to add property to my custom sector , and the property type (Select) , once the builder ready i got this error Cannot read properties of undefined (reading 'replace')
editor.StyleManager.addSector("salma", {
name: "Background Style",
open: true,
properties: [
{
type: 'select',
property: 'background-size',
id: 'background-size',
label: 'Select Size',
default: 'cover',
options: [
{ id: 'cover', label: 'cover' },
{ id: 'contain', label: 'contain' },
{ id: 'fit', label: 'fit' },
],
},
],
},{ at: 0 });
Code of Conduct
- I agree to follow this project's Code of Conduct
Answers (1)
@artf , sorry i found the solution
options: [
{ id: 'cover', label: 'cover', value: 'cover' },
{ id: 'contain', label: 'contain', value: 'contain' },
{ id: 'fit', label: 'fit', value: 'fit' },
],
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3861
BUG: JS error when press "s" or "w" key - Cannot read properties of undefined (reading 'indexOf')
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Version 94.0.4606.81 (Official Buil...
Issue #6040
BUG: Cannot read properties of undefined (reading 'lastComponent')
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 127.0.6533.89 (Official Build) (64...
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 #4940
BUG: Destroying and re-initializing produces "Cannot read properties of undefined (reading 'get')"
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Google Chrome Version 110.0.5481.100 (Offi...
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.