fix(ui): add guard for no highlight labels (#11483)

pull/11485/head
Delmer 2019-01-22 18:33:48 -08:00 committed by GitHub
parent f4136d17f9
commit c88f9186b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -251,6 +251,10 @@ class LabelSelector extends Component<Props, State> {
private handleKeyDown = (e: KeyboardEvent<HTMLInputElement>): void => {
const {highlightedID} = this.state
if (!highlightedID) {
return
}
switch (e.key) {
case 'Escape':
e.currentTarget.blur()