Issue #4413Opened June 27, 2022by YaseenHajajweh1 reactions

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)

YaseenHajajwehJune 27, 20221 reactions

@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.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.