title: How to open the dropdown list in Autocomplete Material-UI by default?
body: <p>In an Autocomplete Form, the data for country and its relevant codes are displayed. When the input text is focused the drop-down list is populated. My intention is to pre load array of data without focus requirement. See the code for example</p>
  <pre><code>const [newValue, setNewValue] = useState(null);
  const [textToggle, textToggleState] = useState(false);
  
  render(
           &lt;div
            style={{ cursor: &quot;pointer&quot; }}
            onClick={() =&gt; {
              textToggleState(!textToggle);
            }}
          &gt;
            &lt;h5&gt;+{newValue == null ? &quot;91&quot; : newValue.calling_code}&lt;/h5&gt;
          &lt;/div&gt;
          {textToggle ? (
            &lt;Autocomplete
              id=&quot;size-small-standard&quot;
              size=&quot;small&quot;
              options={cities}
              onChange={(event, value) =&gt; {
                setNewValue(value);
                textToggleState(!textToggle);
              }}
              autoSelect={true}
              getOptionLabel={(option) =&gt;
                `${option.country}` + `+ ${option.calling_code}`
              }
              renderOption={(option) =&gt; (
                &lt;&gt;{`${option.country} + ${option.calling_code}`}&lt;/&gt;
              )}
              //defaultValue={cities[98]}
              style={{ width: &quot;100%&quot; }}
              renderInput={(params) =&gt; (
                &lt;TextField
                  {...params}
                  variant=&quot;standard&quot;
                  placeholder=&quot;Search your country&quot;
                  style={{ width: &quot;40%&quot; }}
                /&gt;
              )}
            /&gt;
          ) : (
            &quot;&quot;
          )}
    &lt;/div&gt;
  )
  </code></pre>
  <p>Here you can see data is displayed on input text focus. What could be the best possible solution to
  pre-load data?</p>
  <p>CodeSandbox Link: <a href="https://codesandbox.io/s/how-to-add-only-single-value-from-autocomplete-in-material-ui-forked-tu218" rel="nofollow noreferrer">https://codesandbox.io/s/how-to-add-only-single-value-from-autocomplete-in-material-ui-forked-tu218</a></p>