Issue #2421💬 AnsweredOpened November 20, 2019by brentonkelly19821 reactions

Number Trait Type Adds Attributes to Element

快速解答by artf1

You forgot changeProp: 1 in your traits

Read full answer below ↓

Question

Working Example: https://codepen.io/brenton-kelly/pen/wvvOgLN

On the latest versions: https://unpkg.com/grapesjs https://unpkg.com/grapesjs/dist/css/grapes.min.css

I created a grid component where the user will set the number of columns and the gutter via trait manager. When I use the "number" type for the traits, my "updateModel" method is never fired from my listener and instead, the traits are added to the csGrid element in the canvas DOM as attributes. When I change the trait type to "text", only my method is called as expected.

Answers (2)

artfNovember 27, 2019

You forgot changeProp: 1 in your traits

brentonkelly1982December 2, 2019

Thank you!

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

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.