title: Control Focus of Multiple FormControl Fields
body: <p>I have a mapped list of input fields:</p>
  
  <pre><code>                      &lt;FormControl
                              name={row_index}
                              value={barcode.barcode}
                              placeholder="Barcode - then Enter"
                              onChange={this.onChange}
                              onKeyPress={this._handleKeyPress}
                              disabled={barcode.submitted}
                          /&gt;
  </code></pre>
  
  <p>I am currently using <code>onKeyPress</code> to handle submit:</p>
  
  <pre><code>_handleKeyPress = (e) =&gt; {
      if (e.key === 'Enter') {
          const name = e.target.name;
          const barcodes = this.state.barcodes;
          const this_barcode = barcodes[name];
  
          let apiFormatted = {"barcode": this_barcode.barcode, "uid": this.props.currentSession}
          this.postBarcodeAPI(apiFormatted, name)
      }
  }
  </code></pre>
  
  <p>I am attempting to focus on the <strong>next</strong> input field after the current one is successfully submitted. React documentation <a href="https://reactjs.org/docs/refs-and-the-dom.html#adding-a-ref-to-a-dom-element" rel="nofollow noreferrer">has an example</a> for manually setting focus on a single input field using <code>ref={(input) =&gt; { this.textInput = input; }} /&gt;</code>. I have tried using <code>this[‘textInput’+‘1’].focus()</code> (using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Object_initializer" rel="nofollow noreferrer">computed property names</a>, but am getting an error that function is invalid.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Per Chase's answer, I am linking to the autofocus documentation, <a href="https://github.com/JedWatson/react-select/issues/1692" rel="nofollow noreferrer">although it doesn't work in this case</a>.</p>
  
  <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus" rel="nofollow noreferrer">https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus</a></p>