Skip to content

Commit 84ee97d

Browse files
authored
Merge pull request #5 from bernhardoj/fix-dismiss-keyboard-android
Dismiss the keyboard when the picker opens on android
2 parents 77cc9d4 + c44c5fe commit 84ee97d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/index.js

+12
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,12 @@ export default class RNPickerSelect extends PureComponent {
532532
onValueChange={this.onValueChange}
533533
selectedValue={selectedItem.value}
534534
{...pickerProps}
535+
onFocus={() => {
536+
Keyboard.dismiss();
537+
if (pickerProps.onFocus) {
538+
pickerProps.onFocus();
539+
}
540+
}}
535541
>
536542
{this.renderPickerItems()}
537543
</Picker>
@@ -557,6 +563,12 @@ export default class RNPickerSelect extends PureComponent {
557563
onValueChange={this.onValueChange}
558564
selectedValue={selectedItem.value}
559565
{...pickerProps}
566+
onFocus={() => {
567+
Keyboard.dismiss();
568+
if (pickerProps.onFocus) {
569+
pickerProps.onFocus();
570+
}
571+
}}
560572
>
561573
{this.renderPickerItems()}
562574
</Picker>

0 commit comments

Comments
 (0)