polymer

Polymer CoreInput set custom validation message and reverse direction


First

It looks like it's possible to set custom validation rules, but I'm wondering if there is any way to customize the validation messages (I need them to be in Arabic).

Second

Is it possible to reverse the direction of paper-input floating label (place it at top right instead of top left).


Solution

  • First

    paper-input exposes a error attribute you can use to declaratively set a custom message. If you want to use core-input directly, that element exposes a setCustomValidity(message) for setting it.

    http://www.polymer-project.org/docs/elements/core-elements.html#core-input

    Second

    That would be a good feature request to file against paper-input. I was able to get something working using CSS overriding, but the internals of the API could change in the future.

    http://jsbin.com/megafucuvapo/1/edit