[BUG] Number Trait Type Adds Attributes to Element
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)
You forgot changeProp: 1 in your traits
Thank you!
Related Questions and Answers
Continue research with similar issue discussions.
Issue #6024
BUG: unable to hide rte for some particular component type
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Issue #6019
BUG: unable to hide rte in latest versions
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://code...
Issue #4947
BUG: Undo manager not working properly on undoing a remove action
GrapesJS version[X] I confirm to use the latest version of GrapesJSWhat browser are you using? Chrome - version 110.0.5481.100 (Official Bu...
Issue #1591
[Bug] Component attributes forced to lowercase on load when using fromElement
When GrapesJs is initialized using "fromElement", the attributes in the HTML tags of the element are forced to lowercase. View live example...
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.