diff --git a/components/Dropdown.js b/components/Dropdown.js index dacc385..d422242 100644 --- a/components/Dropdown.js +++ b/components/Dropdown.js @@ -57,13 +57,14 @@ class Dropdown extends React.PureComponent { userInputtedValue = '' render() { - const { color, selected, onChange, itemWrapper, icon, disableInput } = this.props + const { innerRef, color, selected, onChange, itemWrapper, icon, disableInput } = this.props const { itemsToShow, inputValue } = this.state const minWidth = calcMinWidth(itemsToShow) return ( it === selected)} diff --git a/components/Themes/index.js b/components/Themes/index.js index 01cd418..56b75fd 100644 --- a/components/Themes/index.js +++ b/components/Themes/index.js @@ -51,6 +51,8 @@ class Themes extends React.PureComponent { selected: null } + dropdown = React.createRef() + componentDidMount() { const storedThemes = getThemes(localStorage) || [] @@ -76,9 +78,10 @@ class Themes extends React.PureComponent { highlights: themes.find(({ id }) => id === preset).highlights })) - handleDropdown = ({ id }) => { + handleChange = ({ id }) => { if (id === 'create') { this.props.toggleVisibility() + this.dropdown.current.closeMenu() } else { this.props.updateTheme(id) } @@ -153,13 +156,14 @@ class Themes extends React.PureComponent { return (
{isVisible && (