[Bug] Number trait returns 'undefined'
Question
Hello, it's either a bug or a question, i don't know yet. I defined a new component with - beside others - a number trait, as you can see on the code below. Unfortunately when adjusting the number over the arrows coming along with the trait automatically, it very often switches to 'undefined'.
Am I missing something or is this a bug?
domComps.addType('socialbar', {
model: dModel.extend({
defaults: Object.assign({}, dModel.prototype.defaults, {
showShares: 1,
size: 32,
radius: '4',
droppable: !1,
traits: [
{
label: "Show Shares",
type: "checkbox",
name: "showShares",
changeProp: 1
},
{
type: 'select',
name: 'size',
label: 'Icon Size',
changeProp: 1,
options: [
{value: '16', name: '16 Pixels'},
{value: '32', name: '32 Pixels'},
{value: '64', name: '64 Pixels'}
]
},
{
type: 'number',
name: 'radius',
label: 'Icon Radius',
unit: 'px',
changeProp: 1,
}
]
})
},
{
isComponent: function(el) {
if (el.getAttribute && "socialbar" == el.getAttribute("data-gjs-type")) {
return {type: 'socialbar'};
}
},
}),
view: dView
});Answers (2)
For such an issue I'd require a live demo because you might be using an old version. BTW I wasn't able to reproduce it, so it might also be fixed. In case it's not, please open another issue, with a link to a live demo and exact steps on how to reproduce it
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 #1895
[QUESTION] Drag component over canvas with script, script appended multiple times.
Hi, not sure if this is a bug or not. But I noticed a weird behavior, when I drag a block that has a component that contains a script funct...
Issue #1681
adding new custom trait to Video Component
In video Component i need to add new custom traits beside the existing ones, when i do this all traits are disappeared
Issue #1520
[Bug] On this.components() Error : Uncaught TypeError: Cannot read property 'each' of undefined
Get below error for this.components() not sure if it is bug or I am doing something wrong. Uncaught TypeError: Cannot read property 'each'...
Issue #1496
issue in adding new row cell in grapejs not working
i am using grapejs version 0.14.33 with angular 6 i want to add a section with 2 blocks on block manager as created on grapejs demo. and fo...
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.