Material-ui-pickers: Formik does not mark as touched when focus on material-ui/pickers

Created on 16 Jan 2020  路  2Comments  路  Source: mui-org/material-ui-pickers

Environment

| Tech | Version |
| -------------------- | ------- |
| @material-ui/pickers | 3.2.8 |
| formik | 2.1.2 |
| yup| | 0.28.0

Steps to reproduce

Change input or focus on the picker component

Expected behavior

Set touched object contain the name of the picker component

Actual behavior

Not working as expected

Live example

https://codesandbox.io/s/formik-material-ui-date-picker-with-yup-validate-3odn7?from-embed

Most helpful comment

@thanhmd
While figuring out an issue with the latest 4.0-alpha builds I stumbled upon your issue. Your sandbox is missing the onBlur callback from Formik.

<KeyboardDatePicker
   ...
  onBlur={props.handleBlur}
/>

All 2 comments

@thanhmd
While figuring out an issue with the latest 4.0-alpha builds I stumbled upon your issue. Your sandbox is missing the onBlur callback from Formik.

<KeyboardDatePicker
   ...
  onBlur={props.handleBlur}
/>

I had the same issue as OP. I will try that tomorrow.
Thank you for the response!

EDIT:
Sorry for the late response. Your solution fixes the issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lysander picture Lysander  路  3Comments

callmeberzerker picture callmeberzerker  路  3Comments

nicky-dev picture nicky-dev  路  3Comments

sakulstra picture sakulstra  路  3Comments

killjoy2013 picture killjoy2013  路  3Comments