File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
packages/core/src/components/Picker Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import PickerInputContainer from "./PickerInputContainer";
1414import { withTheme } from "@draftbit/theme" ;
1515
1616const isIos = Platform . OS === "ios" ;
17+ const isAndroid = Platform . OS === "android" ;
1718const isWeb = Platform . OS === "web" ;
1819
1920const NativePicker : React . FC < CommonPickerProps & SinglePickerProps > = ( {
@@ -121,7 +122,8 @@ const NativePicker: React.FC<CommonPickerProps & SinglePickerProps> = ({
121122 { ...rest }
122123 >
123124 { /* Web version is collapsed by default, always show to allow direct expand */ }
124- { ( pickerVisible || isWeb ) && ! disabled && renderPicker ( ) }
125+ { /* Android version needs to always be visible to allow .focus() call to launch the dialog */ }
126+ { ( pickerVisible || isAndroid || isWeb ) && ! disabled && renderPicker ( ) }
125127 </ PickerInputContainer >
126128 ) ;
127129} ;
@@ -141,6 +143,9 @@ const styles = StyleSheet.create({
141143 web : {
142144 height : "100%" , //To have the <select/> element fill the height
143145 } ,
146+ android : {
147+ opacity : 0 , // picker is a dialog, we don't want to show the default 'picker button' component
148+ } ,
144149 } ) ,
145150 } ,
146151 iosNativePicker : {
You can’t perform that action at this time.
0 commit comments