Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Boolean attributes on Web Components #9230

@nickdima

Description

@nickdima

When setting boolean attributes on Web Components
<x-search somebool name={this.props.name} />
they get rendered as attribute/value pairs instead
<x-search somebool="true" name={this.props.name}>

This causes problems with some AMP components, for eg. <amp-iframe /> which has a resizable attribute that gets rendered as resizable="true". This results in non valid AMP content and developers crying with blood tears on their keyboards :)

The attribute 'resizable' in tag 'amp-iframe' is set to the invalid value 'true'. (see https://www.ampproject.org/docs/reference/components/amp-iframe)

Is there any reason for the current behaviour? Will changing this break something else?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions