From f7f6b9d96911ce66bb4a61f9183a6574242c97ef Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 10 Mar 2023 06:51:01 -0800 Subject: [PATCH] Dismiss the keyboard when the picker opens on android --- src/index.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/index.js b/src/index.js index bcbc93e8..5c2e84ae 100644 --- a/src/index.js +++ b/src/index.js @@ -499,6 +499,12 @@ export default class RNPickerSelect extends PureComponent { onValueChange={this.onValueChange} selectedValue={selectedItem.value} {...pickerProps} + onFocus={() => { + Keyboard.dismiss(); + if (pickerProps.onFocus) { + pickerProps.onFocus(); + } + }} > {this.renderPickerItems()} @@ -524,6 +530,12 @@ export default class RNPickerSelect extends PureComponent { onValueChange={this.onValueChange} selectedValue={selectedItem.value} {...pickerProps} + onFocus={() => { + Keyboard.dismiss(); + if (pickerProps.onFocus) { + pickerProps.onFocus(); + } + }} > {this.renderPickerItems()}