[BUG] Custom Trait documentation example doesn't work
Question
Specifically this:
https://grapesjs.com/docs/modules/Traits.html#define-new-trait-type
First of all, the keyUp event references onChange when the function name is actually onChange. Next, even if you fix this, this.model.get('value') evaluates to a blank/null value whenever I make changes to it. The only way I can seem to get the actual value is to reference it at e.srcElement.value. That doesn't seem like the correct way to do it though so I would assume something with the get() code is not working right.
Answers (2)
Nevermind. I was misunderstanding the syntax. I didn't realize that the onChange and the onValueChange are 2 different unrelated methods apparently. It's not clear to me what onChange does exactly.
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 #1930
[QUESTIONS] change 2 attributes with 1 trait
I have an input trait, I want to change the 2 attributes (name and type) on the selected input element, on canvas is appropriate, but in th...
Issue #1047
[BUG] Model not able to change after changing value in custom Select dropdown menu.
Hey, I'm using CDN link for grapes js from unpkg.com In my project, I've used custom trait as a drop-down select menu which changes HTML us...
Issue #1586
[Question] update Trait select option dynamically
I tried this to update trait selection. var updateTrait = function(id, name) { var typeTrait = model.get('traits').where({name: 'type'})[0]...
Issue #1092
[BUG]traits and storage trigger
Hey, maybe it's not bug, i'm not sure. I have traits with changeProp: true field. When I change the value of trait by UI, model is changed...
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.