Skip to content

Commit 4f54334

Browse files
committed
docs(picker): correct picker doc
1 parent 44a248c commit 4f54334

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,15 +366,18 @@ Pass in the Formik touched value for the input as a prop.
366366
Wraps your component into a `TouchableOpacity` which, when pressed, opens a dialog to pick a value.
367367
You need to provide a `values` props with the pickable items.
368368

369+
If you need to dismiss the picker's "Keyboard", you can use `KeyboardModal.dismiss()` like below.
370+
369371
```javascript
370372
import { TextInput, View } from 'react-native';
371-
import { withPickerValues } from 'react-native-formik';
373+
import { compose } from "recompose";
374+
import makeInput, { KeyboardModal, withPickerValues } from 'react-native-formik';
372375

373-
const MyPicker = withPickerValues(TextInput);
376+
const MyPicker = compose(makeInput, withPickerValues)(TextInput);
374377

375378
export default props => (
376379
<Formik
377-
onSubmit={values => console.log(values)}
380+
onSubmit={values => { KeyboardModal.dismiss(); console.log(values); }}
378381
validationSchema={validationSchema}
379382
render={props => {
380383
return (

0 commit comments

Comments
 (0)