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 = {
145145 */
146146 disabled : PropTypes . bool ,
147147
148+ /**
149+ * If false, the menu of the dropdown will not close once a value is selected.
150+ */
151+ closeMenuOnSelect : PropTypes . bool ,
152+
148153 /**
149154 * height of each option. Can be increased when label lengths would wrap around
150155 */
@@ -232,6 +237,7 @@ Dropdown.defaultProps = {
232237 searchable : true ,
233238 optionHeight : 35 ,
234239 maxHeight : 200 ,
240+ closeMenuOnSelect : true ,
235241 persisted_props : [ 'value' ] ,
236242 persistence_type : 'local' ,
237243} ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ const RDProps = [
3333 'maxHeight' ,
3434 'style' ,
3535 'className' ,
36+ 'closeMenuOnSelect'
3637] ;
3738
3839const Dropdown = props => {
@@ -46,6 +47,7 @@ const Dropdown = props => {
4647 style,
4748 loading_state,
4849 value,
50+ closeMenuOnSelect,
4951 } = props ;
5052 const [ optionsCheck , setOptionsCheck ] = useState ( null ) ;
5153 const persistentOptions = useRef ( null ) ;
@@ -158,6 +160,7 @@ const Dropdown = props => {
158160 value = { value }
159161 onChange = { onChange }
160162 onInputChange = { onInputChange }
163+ closeMenuOnSelect = { closeMenuOnSelect }
161164 backspaceRemoves = { clearable }
162165 deleteRemoves = { clearable }
163166 inputProps = { { autoComplete : 'off' } }
You can’t perform that action at this time.
0 commit comments