Issue #4774Opened December 9, 2022by edenizk1 reactions

BUG: Can't set traits in attributes

Question

GrapesJS version

  • I confirm to use the latest version of GrapesJS

What browser are you using?

Firefox

Reproducible demo link

https://jsfiddle.net/9aj630x7/

Describe the bug

How to reproduce the bug?

  1. Create a element
  2. set data-gjs-traits attribute to any default trait name like id or title, it will crush the whole thing

What is the expected behavior? I expect the same result as the data-gjs-traits='' which is setting traits empty

What is the current behavior? If I will place there something else than empty string it will crush the grapes

If is necessary to execute some code in order to reproduce the bug, paste it here below:

// your code here

Code of Conduct

  • I agree to follow this project's Code of Conduct

Answers (1)

artfDecember 13, 20221 reactions

You should use properly parsable JSON strings eg, data-gjs-traits='["id"]', data-gjs-traits="[]"

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.