Skip to content
This repository was archived by the owner on Dec 19, 2024. It is now read-only.

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants