Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Setting gold-email-input's auto-validate to "false" in the html does not work #40

Closed
exactspace opened this issue Oct 20, 2015 · 1 comment

Comments

@exactspace
Copy link

If I create a gold-email-input and set the auto-validate to false, (auto-validate="false") it still autovalidates! This works differently than say a paper-input that I can actually set auto-validate="false" within the html, and it doesn't autovalidate. However, if I get rid of "auto-validate" in gold-email-input it will set it to false as it's default.

Even if I set the gold-email-input attribute "auto-validate" to "false" in JavaScript, it has no effect.

@notwaldorf
Copy link
Contributor

That's not how boolean attributes work in Polymer (see Polymer/polymer#1812 for a very detailed discussion, see this for the docs: https://www.polymer-project.org/1.0/docs/devguide/properties.html#attribute-deserialization). If you want a boolean attribute to be false, you need to remove it altogether, not set it to false. So, this element does not auto-validate:

<gold-email-input></gold-email-input>

While both of these will validate, because the attribute is present:

<gold-email-input auto-validate></gold-email-input>
<gold-email-input auto-validate="false"></gold-email-input>

The same happens for paper-input, too: https://jsbin.com/hedoya/edit?html,output

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