Issue #2844Opened June 20, 2020by akashdesale980 reactions

[BUG] If we give "<input data-gjs-type="myInput" type="text" required/>" this html string to setComponents, it sets it like "<input data-gjs-type="myInput" type="text" required=""/>" in code manager

Question

editor.setComponents("html stiring"), method which takes html string as an input and sets that code in the html section in the Code Manager

if we pass ,<input data-gjs-type="myInput" type="text" required/>" to editor.setComponents,

then its output will be "<input data-gjs-type="myInput" type="text" required=""/>

If you see setComponents is adding extra strings to required tag , it happens with every single attribute like autofocus, disabled and all othe single boolean tags?

is there any way to avoid this?

Answers (1)

artfJune 25, 20200 reactions

For now, you can avoid it only by adding the Component Definition in this way

editor.addComponents({ 
    tagName: 'input',
    attributes: { type: 'text', required: true }
})

but I'll update the HTML parser in the next release to handle this properly

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.