dart-archive / polymer_elements

https://pub.dartlang.org/packages/polymer_elements
BSD 3-Clause "New" or "Revised" License
24 stars 17 forks source link

paper-textarea shows error message with auto-validate by default #103

Open rafaelalvessa opened 8 years ago

rafaelalvessa commented 8 years ago

I defined a required paper-textarea element with auto validation and an error message this way:

<paper-textarea auto-validate error-message="Please enter a message" label="Message" required></paper-textarea>

When the element is rendered, it displays the error message by default even before the element is clicked on and gets focus. I've defined paper-input elements in a similar way and the error message is only displayed after the elements are clicked on and get focus, so by default their error message is hidden when they're rendered. For example:

<paper-input auto-validate error-message="Please enter a name" label="Name" required></paper-input>

The error message is hidden by default for name, and displayed by default for message before the elements are clicked and get focus.

I had to write some code in Dart to add the auto-validate property to the paper-textarea element only after it is clicked on. Is there a way to prevent this without any Dart code? In order to be consistent, paper-textarea should only display the error message after the element is clicked on just like paper-input. I don't know whether this is intentional or a bug.