booleanAttr for components #1371

Merged
merged 1 commit into from Feb 16, 2015

Conversation

Projects
None yet
4 participants
@zkat
Contributor

zkat commented Dec 16, 2014

Components that want to use HTML-style booleans are currently forced to write this function manually. I think this is valuable enough to can.Component users that it's good to have built-in to the define plugin.

@zkat

This comment has been minimized.

Show comment
Hide comment
@zkat

zkat Dec 16, 2014

Contributor

Alternately, we might call this "htmlbool" or similar. Say the word and I'll push a fix.

Contributor

zkat commented Dec 16, 2014

Alternately, we might call this "htmlbool" or similar. Say the word and I'll push a fix.

@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Dec 21, 2014

Contributor

How this is supposed to be used, elaborate, please.

Contributor

whitecolor commented Dec 21, 2014

How this is supposed to be used, elaborate, please.

@zkat

This comment has been minimized.

Show comment
Hide comment
@zkat

zkat Dec 22, 2014

Contributor

In HTML, boolean attributes are provided by simply writing the name of the attribute itself without a "value":

<script async>...</script>

In this example, async would be interpreted as true by the <script> tag. The attribute's absence implies it's false. See http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.4.2

Contributor

zkat commented Dec 22, 2014

In HTML, boolean attributes are provided by simply writing the name of the attribute itself without a "value":

<script async>...</script>

In this example, async would be interpreted as true by the <script> tag. The attribute's absence implies it's false. See http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.3.4.2

@whitecolor

This comment has been minimized.

Show comment
Hide comment
@whitecolor

whitecolor Dec 22, 2014

Contributor

Yes I think this is needed, maybe even add feature like no- prefix to such attributes that will negate the value `and``

Contributor

whitecolor commented Dec 22, 2014

Yes I think this is needed, maybe even add feature like no- prefix to such attributes that will negate the value `and``

@daffl daffl added this to the 2.2.0 milestone Feb 9, 2015

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Feb 9, 2015

Contributor

Looks good. Do we need to add a test for this though?

Contributor

daffl commented Feb 9, 2015

Looks good. Do we need to add a test for this though?

@justinbmeyer

This comment has been minimized.

Show comment
Hide comment
@justinbmeyer

justinbmeyer Feb 10, 2015

Contributor

And docs.

Contributor

justinbmeyer commented Feb 10, 2015

And docs.

@zkat

This comment has been minimized.

Show comment
Hide comment
@zkat

zkat Feb 16, 2015

Contributor

@daffl done

Contributor

zkat commented Feb 16, 2015

@daffl done

daffl added a commit that referenced this pull request Feb 16, 2015

@daffl daffl merged commit fad30b6 into minor Feb 16, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@daffl daffl deleted the boolean-attr-type branch Feb 16, 2015

@daffl daffl removed the fixed in branch label Feb 20, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment