Issue #1894Opened March 14, 2019by jwilson-lyonscg0 reactions

[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)

jwilson-lyonscgMarch 14, 20190 reactions

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.

lock[bot]March 17, 20200 reactions

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.

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.