diff --git a/src/index.js b/src/index.js index e67129d1..a5fd5ab7 100644 --- a/src/index.js +++ b/src/index.js @@ -72,6 +72,9 @@ export class Select extends Component { if (this.select) { this.updateSelectBounds(); } + if (this.props.defaultMenuIsOpen) { + this.dropDown('open'); + } } componentDidUpdate(prevProps, prevState) { @@ -568,7 +571,8 @@ Select.defaultProps = { separator: false, sortBy: null, valueField: 'value', - values: [] + values: [], + defaultMenuIsOpen: false }; const ReactDropdownSelect = styled.div` diff --git a/src/models/SelectPropsModel.js b/src/models/SelectPropsModel.js index ca9dd4c1..c2375b2a 100644 --- a/src/models/SelectPropsModel.js +++ b/src/models/SelectPropsModel.js @@ -261,6 +261,10 @@ const SelectPropsModel = Object.freeze({ * Selected values */ values: PropTypes.array, + /** + * If true, dropdown will be open by default + */ + defaultMenuIsOpen: PropTypes.bool, }); export default SelectPropsModel;