File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
packages/core/src/components/Picker/dropdown Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ const DropDownPicker: React.FC<
3737 dropDownBorderWidth = 1 ,
3838 dropDownBorderRadius = 8 ,
3939 children : childrenProp ,
40+ disabled,
4041 ...rest
4142} ) => {
4243 const [ pickerVisible , setPickerVisible ] = React . useState ( false ) ;
@@ -83,6 +84,12 @@ const DropDownPicker: React.FC<
8384 }
8485 } , [ pickerVisible , autoDismissKeyboard ] ) ;
8586
87+ React . useEffect ( ( ) => {
88+ if ( disabled ) {
89+ setPickerVisible ( false ) ;
90+ }
91+ } , [ disabled ] ) ;
92+
8693 return (
8794 < PickerInputContainer
8895 testID = "dropdown-picker"
@@ -92,6 +99,7 @@ const DropDownPicker: React.FC<
9299 options = { options }
93100 onPress = { ( ) => setPickerVisible ( ! pickerVisible ) }
94101 zIndex = { pickerVisible ? 100 : undefined } // Guarantees drop down is rendered above all sibling components
102+ disabled = { disabled }
95103 { ...rest }
96104 >
97105 < DropDownPickerComponent
You can’t perform that action at this time.
0 commit comments