formik
formik copied to clipboard
useFormik with input="search" not working correctly.
Bug report
Current Behavior
useFormik with input type="search" not working correctly. BackSpace not working.
const formik = useFormik({
initialValues: {
...currentValues
},
onSubmit: (values) => {
alert(JSON.stringify(values, null, 2));
},
validationSchema: InfoSchema,
enableReinitialize: true,
validateOnMount: true,
});
const titleComponent = useMemo(()=>(
<div>
<input
name="xinfo_title"
type="search"
placeholder="title..."
{...formik.getFieldProps('xinfo_title')}
/>
</div>
),[formik]);
But change to type="text" everything is normal just works.
const titleComponent = useMemo(()=>(
<div>
<input
name="xinfo_title"
type="text"
placeholder="title..."
{...formik.getFieldProps('xinfo_title')}
/>
</div>
),[formik]);
Did I do something wrong?
Your environment
| Software | Version(s) |
|---|---|
| Formik | 2.2.9 |
| React | 17.0.2 |
| TypeScript | |
| Browser | |
| npm/Yarn | |
| Operating System |