Issue #413💬 AnsweredOpened October 12, 2017by FrikkieSnyman0 reactions

Use trait to modify component class

Quick answerby FrikkieSnyman

@artf Is this even possible?

Read full answer below ↓

Question

Hi! I'm trying to change the value of the classes with very little succes. Here is my custom trait's onValueChange function: Which results in an HTML output of: Obviously, this isn't legal HTML. It also produces weird results when adding or removing a class in the Classes input. What is the correct way to go about this?

Answers (3)

FrikkieSnymanOctober 13, 2017

@artf Is this even possible?

FrikkieSnymanOctober 16, 2017

So I got this figured out, in a quite hacky way, but it works! Just create a custom trait, and use the following for the onValueChange()

lock[bot]September 18, 2019

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

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.