0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-03-22 04:38:11 +00:00

Merge pull request #4662 from naturalcrit/update-dependencies

Small fix of string ref in combobox for latest react
This commit is contained in:
Víctor Losada Hernández
2026-03-03 22:40:32 +01:00
committed by GitHub

View File

@@ -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 (
<div className={`dropdown-container ${this.props.className}`}
ref='dropdown'
ref={this.dropdownRef}
onMouseLeave={this.props.trigger == 'hover' ? ()=>{this.handleDropdown(false);} : undefined}>
{this.renderTextInput()}
{this.renderDropdown(dropdownChildren)}