jeudi 18 juin 2020

Multielect in a dropdown list in React

I am trying to be able to multi select different values from a dropdown I created. So the following code is actually showing the names of the people but I would like to be able to select more than one.

<Form.Group controlId="exampleForm.ControlSelect4">
  <Form.Label> Names </Form.Label>
    <Form.Control as="select" value={this.state.selectedNames} onChange={this.updateTable}>
                {this.state.names.map((name) => <option key={name.value} value={name.value}> {name.display } </option>)}
    </Form.Control>
</Form.Group>



Aucun commentaire:

Enregistrer un commentaire