check if element exists before reading if it's active

This commit is contained in:
Sean Yesmunt 2019-12-20 17:18:16 -05:00
parent c9dc97298a
commit 20deb3825b

View file

@ -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() {