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?
- Create a element
- set data-gjs-traits attribute to any default trait name like
idortitle, 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)
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.
Issue #6039
BUG: Cannot set Block display value
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 126 Reproducible demo link https://...
Issue #4310
BUG: Style Manager is inaccurate when using combined CSS selectors which contains "bout" and componentFirst = true
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome 100 Reproducible demo link https://...
Issue #6705
BUG: TypeError: Cannot read properties of undefined (reading 'toLowerCase') in keyboard handler
GrapesJS version [x] I confirm to use the latest version of GrapesJS What browser are you using? All browsers (Chrome, Safari, Firefox, Edg...
Issue #5882
BUG: ID isn't updating after change
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Chrome Reproducible demo link https://jsfi...
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.