N
N
Ninja Mate2016-02-16 13:17:12
JavaScript
Ninja Mate, 2016-02-16 13:17:12

How to make Collapse an element that listens not to a button, but to Input type="select"?

I am using the React-bootstrap library and there is a Collapse element

render() {
    return (
      <div>
        <Button onClick={ ()=> this.setState({ open: !this.state.open })}>
          click
        </Button>
        <Collapse in={this.state.open}>
          <div>
            <Well>
              Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid.
              Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
            </Well>
          </div>
        </Collapse>
      </div>
    );
  }

And everything works great.
But I'm trying to make an input select and that the event (opens an additional field) starts when the user selects an element in the form.
export class UserFirstForm extends Component {

    constructor(...args) {
        super(...args);
        this.state = {

        };
    }

    handleChange() {
        this.setState({

        });
    }

    render() {
        const searchButton =<Button bsSize="xsmall">Let's Search</Button>;
        return (
            <div>

                <form>

                    <Input type="select" label="Please select who the Activity is in relation to:" placeholder="select">
                        <option value="Patient">Patient</option>
                       ...
                        <option value="other" selected={this.handleChange}>Other</option>
                    </Input>

                    <myCollaps/>
              </form>

Help me to understand

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question