availity-reactstrap-validation icon indicating copy to clipboard operation
availity-reactstrap-validation copied to clipboard

how to refresh input value after a ValideSubmit has changed props ?

Open liitfr opened this issue 7 years ago • 1 comments

Hi !

First of all thanks for this very useful package !

Following question may be trivial.

render() {
    const { loading, user } = this.props;

    return !loading ? (
      <AvForm className="ProfilePassword" onValidSubmit={this.handleValidSubmit} model={user} >
        <Row>
          <Col xs="6">
            <AvGroup>
              <Label for="firstName">Prénom</Label>
              <AvInput type="text" name="profile.name.first" id="firstName" required />
              <AvFeedback>Quel est votre prénom ?</AvFeedback>
            </AvGroup>
          </Col>
          <Col xs="6">
            <AvGroup>
              <Label for="lastName">Nom</Label>
              <AvInput type="text" name="profile.name.last" id="lastName" required />
              <AvFeedback>Quel est votre nom ?</AvFeedback>
            </AvGroup>
          </Col>
        </Row>
....

On server side, firstName & lastName get automatically capitalized when submitted. My props get updated but content of input is not.

Am I missing something ?

i've tried #29 suggestion :

  componentWillReceiveProps() {
    this.form.reset();
  }
...
<AvForm className="ProfilePassword" onValidSubmit={this.handleValidSubmit} model={user} innerRef={(c) => { this.form = c; }} >
...

But it still doesn't work :(

Thank you for your help !

liitfr avatar Oct 26 '17 19:10 liitfr

hey @liitfr , did you find the solution. i am facing the same problem and not able to solve it

MukeshNegi7579 avatar Jun 19 '19 04:06 MukeshNegi7579