[Bug] Component attributes forced to lowercase on load when using fromElement
Question
When GrapesJs is initialized using "fromElement", the attributes in the HTML tags of the element are forced to lowercase.
View live example (uses latest version): https://codesandbox.io/s/zr139yj3m3
Look at the index.html file and the on-Tap property of the div. But upon initializing, if you view the code using the export command, you will see that the attribute has been changed to on-tap.
Expected behavior would be that the attribute name would remain unchanged.
Answers (3)
Expected behavior would be that the attribute name would remain unchanged.
This is how HTML5 works
Thanks @artf. If I create a trait with camelcase name then it seems to be working fine when value added through "Settings" but when element is initialized on canvas or block is dropped then the name is forced lowercase.
I am trying to get Angular attributes added to the template - like *ngIf - can you please suggest a good way forward.
Then you just shouldn't initialize the editor by HTML, but use Component objects, then check how to store correctly your template data https://grapesjs.com/docs/modules/Storage.html#store-and-load-templates
Related Questions and Answers
Continue research with similar issue discussions.
Issue #912
[BUG]: HTML attributes/traits not escaped
When double quotes are added to an attribute it breaks the HTML.https://jsfiddle.net/szLp8h4n/Drag in the link block.Click the link in the...
Issue #873
[Need help]: After using urlLoad from storage manager impossible to change component with Traits
Hello, I am save template to db and after loading from db impossible to change component with Traits. Video example on countdown: https://y...
Issue #998
[BUG] Asset Manager sends empty request when uploading image
Description: GrapesJS editor is initialized in an editor.html file as follows: localhost:9001 is a local IIS server running PHP5. The conte...
Issue #1104
[Bug] Color trait can't setup property after 0.14.9
After v0.14.9 color trait can't setup component property when user press "OK" on colorpicker form. Live:v0.14.9 https://jsfiddle.net/Lqm7ou...
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.