diff --git a/client/components/combobox.jsx b/client/components/combobox.jsx index 5060b8ecf..4d850b00d 100644 --- a/client/components/combobox.jsx +++ b/client/components/combobox.jsx @@ -21,6 +21,7 @@ const Combobox = createReactClass({ }; }, getInitialState : function() { + this.dropdownRef = React.createRef(); return { showDropdown : false, value : '', @@ -41,7 +42,7 @@ const Combobox = createReactClass({ }, handleClickOutside : function(e){ // Close dropdown when clicked outside - if(this.refs.dropdown && !this.refs.dropdown.contains(e.target)) { + if (this.dropdownRef.current && !this.dropdownRef.current.contains(e.target)) { this.handleDropdown(false); } }, @@ -128,7 +129,7 @@ const Combobox = createReactClass({ }); return (
{this.handleDropdown(false);} : undefined}> {this.renderTextInput()} {this.renderDropdown(dropdownChildren)}