Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Customize Input on Validation Error #49

Closed
gabrielbuzziv opened this issue May 18, 2019 · 5 comments
Closed

Customize Input on Validation Error #49

gabrielbuzziv opened this issue May 18, 2019 · 5 comments

Comments

@gabrielbuzziv
Copy link

What would you like to be added:
Input customization when validation fail.

Why is this needed:
Cause this give us possibility of adding a custom style to the input when it is not valid.
For example: Change input border-color to RED

@marcelobarreto
Copy link

marcelobarreto commented May 19, 2019

Hey, could I take this one or are your working on that? 😄

@lcnogueira
Copy link
Contributor

I think this is a good idea. When I was creating the web app for the "unform challenge", I needed to style the error message with a red color. If we could pass something like a styleError object as a prop would be great.

@victorhermes
Copy link

victorhermes commented Jun 4, 2019

I think is a basic feature to handle and customize erros. I'm creating a app right now and I don't know how to handle this one.

@jpdemagalhaes
Copy link
Contributor

@gabrielbuzziv thanks for the suggestion!

I think that adding a has-error class on the field solves this, what do you think about it? This class would be added automatically by unform when there's an error on the field, then you can style it however you want to.

Could you send us a PR?

@cleitonper cleitonper mentioned this issue Jul 11, 2019
3 tasks
@diego3g
Copy link
Contributor

diego3g commented Feb 13, 2020

Now you can create your own custom input and change input classes or styled when error is present. Check the Simple input guide.

@diego3g diego3g closed this as completed Feb 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants