PolymerElements / paper-input

A Material Design text field
https://www.webcomponents.org/element/PolymerElements/paper-input
130 stars 159 forks source link

auto-validate not work in paper-textarea with custom validator #414

Open jtrs opened 8 years ago

jtrs commented 8 years ago

Description

The paper-textarea element not call the validator function like a paper-input element.

Expected outcome

Validator function for paper-textarea should be called.

Actual outcome

Validator function for paper-textarea don't call.

Live Demo

https://plnkr.co/edit/VtKvhY?p=preview

Steps to reproduce

  1. Type in Label_2 (paper-textarea) a chararacter
  2. It should be shown en error messege, but don't
  3. Type in Label_1 (paper-input) a chararacter
  4. The error message is visible

    Browsers Affected

samuelli commented 7 years ago

Looks like a pretty frustrating bug when using custom validators.

The validator property on the input element doesn't get bound to the nested input element. A workaround involves reaching in and binding it together.

this.$['paper-textarea-instance'].$['input'].validator = this.$['paper-textarea-instance'].validator;
TimLuq commented 7 years ago

I also ran into this. Is this by design or an oversight? The documentation specifically states:

Validation

Currently only required and maxlength validation is supported.

-- Yvonne Yip, May 25, 2015

I see that @jtrs tried to fix this themselves but the PR #450 failed CLA and the interest was dropped.

DomNomNom commented 7 years ago

Still running into this.