fix bug that occurs when escape is hit on dropdowns

main
Mike Fix 6 years ago
parent d4538305b9
commit f5f53f17d6

@ -257,7 +257,9 @@ class Editor extends React.Component {
} }
updateLanguage(language) { updateLanguage(language) {
this.updateSetting('language', language.mime || language.mode) if (language) {
this.updateSetting('language', language.mime || language.mode)
}
} }
updateBackground({ photographer, ...changes } = {}) { updateBackground({ photographer, ...changes } = {}) {

@ -67,12 +67,14 @@ class Themes extends React.PureComponent {
} }
handleThemeSelected = theme => { handleThemeSelected = theme => {
const { toggleVisibility, update } = this.props if (theme) {
if (theme.id === 'create') { const { toggleVisibility, update } = this.props
toggleVisibility() if (theme.id === 'create') {
this.dropdown.current.closeMenu() toggleVisibility()
} else { this.dropdown.current.closeMenu()
update(theme.id) } else {
update(theme.id)
}
} }
} }

Loading…
Cancel
Save