File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
components/dash-core-components/src Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -145,6 +145,11 @@ Dropdown.propTypes = {
145
145
*/
146
146
disabled : PropTypes . bool ,
147
147
148
+ /**
149
+ * If false, the menu of the dropdown will not close once a value is selected.
150
+ */
151
+ closeMenuOnSelect : PropTypes . bool ,
152
+
148
153
/**
149
154
* height of each option. Can be increased when label lengths would wrap around
150
155
*/
@@ -232,6 +237,7 @@ Dropdown.defaultProps = {
232
237
searchable : true ,
233
238
optionHeight : 35 ,
234
239
maxHeight : 200 ,
240
+ closeMenuOnSelect : true ,
235
241
persisted_props : [ 'value' ] ,
236
242
persistence_type : 'local' ,
237
243
} ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const RDProps = [
33
33
'maxHeight' ,
34
34
'style' ,
35
35
'className' ,
36
+ 'closeMenuOnSelect'
36
37
] ;
37
38
38
39
const Dropdown = props => {
@@ -46,6 +47,7 @@ const Dropdown = props => {
46
47
style,
47
48
loading_state,
48
49
value,
50
+ closeMenuOnSelect,
49
51
} = props ;
50
52
const [ optionsCheck , setOptionsCheck ] = useState ( null ) ;
51
53
const persistentOptions = useRef ( null ) ;
@@ -158,6 +160,7 @@ const Dropdown = props => {
158
160
value = { value }
159
161
onChange = { onChange }
160
162
onInputChange = { onInputChange }
163
+ closeMenuOnSelect = { closeMenuOnSelect }
161
164
backspaceRemoves = { clearable }
162
165
deleteRemoves = { clearable }
163
166
inputProps = { { autoComplete : 'off' } }
You can’t perform that action at this time.
0 commit comments