check if element exists before reading if it's active
This commit is contained in:
parent
c9dc97298a
commit
20deb3825b
1 changed files with 1 additions and 1 deletions
|
@ -522,7 +522,7 @@ export default class Autocomplete extends React.Component {
|
|||
|
||||
isInputFocused() {
|
||||
const el = this.refs.input;
|
||||
return el.ownerDocument && el === el.ownerDocument.activeElement;
|
||||
return el ? el.ownerDocument && el === el.ownerDocument.activeElement : false;
|
||||
}
|
||||
|
||||
handleInputClick() {
|
||||
|
|
Loading…
Reference in a new issue