Fix pressing enter when no search results
parent
f879348e2e
commit
4467fbd021
|
@ -377,14 +377,19 @@ export default class Picker extends React.PureComponent {
|
||||||
|
|
||||||
handleKeyDown(e) {
|
handleKeyDown(e) {
|
||||||
let handled = false
|
let handled = false
|
||||||
|
|
||||||
switch (e.keyCode) {
|
switch (e.keyCode) {
|
||||||
case 13:
|
case 13:
|
||||||
handled = true
|
let emoji
|
||||||
if (this.SEARCH_CATEGORY.emojis) {
|
|
||||||
this.handleEmojiSelect(this.SEARCH_CATEGORY.emojis[0])
|
if (this.SEARCH_CATEGORY.emojis && (emoji = this.SEARCH_CATEGORY.emojis[0])) {
|
||||||
|
this.handleEmojiSelect(emoji)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handled = true
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (handled) {
|
if (handled) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue