Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The errorMessage is shown in grey before validation fails #267

Closed
Gervwyk opened this issue Apr 11, 2017 · 4 comments
Closed

The errorMessage is shown in grey before validation fails #267

Gervwyk opened this issue Apr 11, 2017 · 4 comments
Assignees
Labels
Type: Feature New features and feature requests

Comments

@Gervwyk
Copy link
Contributor

Gervwyk commented Apr 11, 2017

When using errorMessage prop, the error message is shown in grey before the validation fails on all themes.
Using this schema:

new SimpleSchema({
    STRING: {
         type: String,
         regEx: /^[A-Z]*$/,
         uniforms: {
             errorMessage: "ERROR here"
          }
     }
})

Do we really want to show the error before validation? It would be nice if we could have the error only show when validation fails or make it optional somehow.

@Gervwyk Gervwyk changed the title When using the errorMessage prop on fields, the errorMessage is shown in grey before validation fails The errorMessage is shown in grey before validation fails Apr 11, 2017
@radekmie radekmie self-assigned this Apr 11, 2017
@radekmie radekmie added the Type: Feature New features and feature requests label Apr 11, 2017
@radekmie
Copy link
Contributor

Indeed, a lot of fields are checking for errorMessage instead of error - it's reasonable to change it, because it will allow customization like this. Would you submit a PR for it?

@Gervwyk
Copy link
Contributor Author

Gervwyk commented Apr 11, 2017

I'll make a PR later today. Do we want this optional? Or should we only show the message on error? If optional by what prop / value?

@radekmie
Copy link
Contributor

I see this in this way: uniforms-semantic/NumField

-        {!!(errorMessage && showInlineError) && (
+        {!!(error && showInlineError) && (
             <div className="ui red basic pointing label">
                 {errorMessage}
             </div>
         )}

@Gervwyk
Copy link
Contributor Author

Gervwyk commented Apr 11, 2017

Ok great. I agree. I'll change on all themes and submit PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New features and feature requests
Projects
Archived in project
Development

No branches or pull requests

2 participants