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

[FormsySelect] 'required' is not being enforced #5

Closed
mbrookes opened this issue Oct 21, 2015 · 5 comments
Closed

[FormsySelect] 'required' is not being enforced #5

mbrookes opened this issue Oct 21, 2015 · 5 comments
Labels

Comments

@mbrookes
Copy link
Collaborator

It does correctly affect canSubmit state, but not the field itself.

@mbrookes mbrookes added the bug label Feb 6, 2016
@quangdng
Copy link

Is there any progress on this? This bug is pretty annoying.

@mbrookes
Copy link
Collaborator Author

@quangdng - can you remind me how this manifests? It's a long time since I've looked at it - I should have been more verbose in the issue description!

@simpixelated
Copy link
Contributor

@mbrookes see #28:

Apparently, setting the required attribute on a FormsyText reports the form state as invalid (the submit button can be disabled), but no message appears below the field? Is it the expected behavior? Shouldn't we do something with the showRequired function?

After some testing with [email protected], [email protected], and [email protected], I see that FormsyText doesn't display validationError unless there is a value in the field, which means required and even validations="isExisty" don't display an error on the field.

example:

<FormsyText
  name="first"
  floatingLabelText="First name"
  fullWidth={true}
  validations="isExisty"
  validationError="First name is required"
  required
/>

The validationError never displays, even after invalid submit.

@simpixelated
Copy link
Contributor

I actually think this is an issue in formsy-react. See christianalfoni/formsy-react#241

Basically getErrorMessage returns null for required. If it returned the validationError, this library would work fine. Looks like there's some workarounds on that link, so will continue to dig into it.

@ryanblakeley
Copy link
Collaborator

Closed by #105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants