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) {
this.updateSetting('language', language.mime || language.mode)
if (language) {
this.updateSetting('language', language.mime || language.mode)
}
}
updateBackground({ photographer, ...changes } = {}) {

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

Loading…
Cancel
Save