I have a material-ui autocomplete element
<Autocomplete
id="combo-box-demo"
autoHighlight
openOnFocus
autoComplete
options={this.state.products}
getOptionLabel={option => option.productName}
style={{ width: 300 }}
onChange={this.selectProduct}
renderInput={params => (
<TextField {...params} label="Select Product Name" variant="outlined" />
)}
/>;
I want this element to get focus when I click a button.
I tried using references as discribed here how react programmatically focus input
It worked for other elements but not for autocomplete
please help