jquense / react-formal

Sophisticated HTML form management for React
http://jquense.github.io/react-formal
MIT License
526 stars 52 forks source link

noValidate doesn't work #134

Open alburritos opened 7 years ago

alburritos commented 7 years ago

On the Form component, I have:

<Form
  noValidate
  type={ ... }
  ...>
  <Form.Field
     noValidate={ false }
   .../>
  <Form.Field
    noValidate={ true } .../>
</Form

I assume this means none of the children will be validated. Is there a way to disable validation on specific fields? I've tried throwing noValidate in Form.Field as specified here (tried including and excludingnoValidate in Form): http://jquense.github.io/react-formal/#/api/field?_k=01vpqu, but it doesn't seem to work.

jquense commented 7 years ago

Hey there, noValidate works on both the Form and/or Field components. I confirmed that they are still working in the docs...if you aren't seeing the right behavior could you put together a repo via https://codesandbox.io/

alburritos commented 7 years ago

@jquense Within a single form, are you able to validate certain fields, and ignore validation on other fields? For example, if I have yup.string().required() on a particular field, and that field has noValidate={ true }, the required message won't show and the validation won't occur.

alburritos commented 7 years ago

Also, is the way I'm using it correct? I'm on 0.25.4

jquense commented 7 years ago

yeah, <Form.Field noValidate /> should work as you're describing, it will not validate that field when you change it or submit the form.