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

How to set toggles=false in markup #89

Closed
grokys opened this issue Dec 14, 2015 · 2 comments
Closed

How to set toggles=false in markup #89

grokys opened this issue Dec 14, 2015 · 2 comments

Comments

@grokys
Copy link

grokys commented Dec 14, 2015

The documentation for paper-checkbox says that the toggles flag has a default of false, however this does not appear to be the case:

https://github.com/PolymerElements/iron-checked-element-behavior/blob/master/iron-checked-element-behavior.html#L52

Due to Polymer/polymer#1812 it is impossible to use the following markup to clear the toggles flag:

<paper-checkbox toggles="false>

What is the recommended way to set this property in markup?

@notwaldorf
Copy link
Contributor

With HTML attributes (http://www.w3.org/TR/2008/WD-html5-20080610/semantics.html#boolean), you need to remove the attribute altogether, not set it to false. So the markup you're looking for is

<paper-checkbox></paper-checkbox>

You can do this in JavaScript with

this.removeAttribute('toggles');

@grokys
Copy link
Author

grokys commented Dec 15, 2015

No, you've misunderstood. The point is that the default value of toggles is true. So removing the attribute leaves it at its default value, true. And because you cannot set HTML attributes to false, there appears to be no way to set toggles to false in markup.

As the documentation says the default value is true, I assume this is a bug unless I'm misunderstanding something.

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