Issue #1591Opened November 18, 2018by riteshdalal0 reactions

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

artfNovember 19, 20180 reactions

Expected behavior would be that the attribute name would remain unchanged.

This is how HTML5 works

riteshdalalNovember 19, 20180 reactions

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.

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.