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

booleanAttr for components #1371

Merged
merged 1 commit into from
Feb 16, 2015
Merged

booleanAttr for components #1371

merged 1 commit into from
Feb 16, 2015

Conversation

zkat
Copy link
Contributor

@zkat 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
Copy link
Contributor Author

zkat commented Dec 16, 2014

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

@wclr
Copy link
Contributor

wclr commented Dec 21, 2014

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

@zkat
Copy link
Contributor Author

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

@wclr
Copy link
Contributor

wclr 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
Copy link
Contributor

daffl commented Feb 9, 2015

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

@justinbmeyer
Copy link
Contributor

And docs.

@zkat
Copy link
Contributor Author

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
@daffl daffl deleted the boolean-attr-type branch February 16, 2015 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants