PolymerElements / paper-input

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

Add "add-on" slot to paper-input? #574

Closed igorazevedo closed 7 years ago

igorazevedo commented 7 years ago

I'm wondering if it would be benefitial to add a "add-on" slot to passthrough the internal paper-input-container slot of the same name.

This would allow declaring error messages or descriptions directly in the paper-input element.

notwaldorf commented 7 years ago

paper-input already has an errorMessage property for this (it creates a <paper-input-error> element and distributes it to the paper-input-container)

igorazevedo commented 7 years ago

I'm aware of that, however using a <paper-input-error> element in the add-on slot instead of the errorMessage attribute makes it easier when working with server-side validation as you can use dom-repeat and dom-if to deal with response data.

notwaldorf commented 7 years ago

If you want to use it explicitly, I recommend using paper-input-container itself. paper-input is supposed to be the easy, straight forward path, and this change would go against that paradigm

notwaldorf commented 7 years ago

Closing, as this is not a feature that we should add to paper-input, and there's already alternatives to do this