Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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 #2844

Closed
akashdesale98 opened this issue Jun 20, 2020 · 1 comment

Comments

@akashdesale98
Copy link

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?

@artf
Copy link
Member

artf commented Jun 25, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants