Skip to content

Commit

Permalink
docs(picker): correct picker doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Almouro committed May 22, 2018
1 parent 44a248c commit 4f54334
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -366,15 +366,18 @@ Pass in the Formik touched value for the input as a prop.
Wraps your component into a `TouchableOpacity` which, when pressed, opens a dialog to pick a value.
You need to provide a `values` props with the pickable items.

If you need to dismiss the picker's "Keyboard", you can use `KeyboardModal.dismiss()` like below.

```javascript
import { TextInput, View } from 'react-native';
import { withPickerValues } from 'react-native-formik';
import { compose } from "recompose";
import makeInput, { KeyboardModal, withPickerValues } from 'react-native-formik';

const MyPicker = withPickerValues(TextInput);
const MyPicker = compose(makeInput, withPickerValues)(TextInput);

export default props => (
<Formik
onSubmit={values => console.log(values)}
onSubmit={values => { KeyboardModal.dismiss(); console.log(values); }}
validationSchema={validationSchema}
render={props => {
return (
Expand Down

0 comments on commit 4f54334

Please sign in to comment.