Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit field editable programmically #128

Open
Dannnyho opened this issue Apr 18, 2018 · 1 comment
Open

edit field editable programmically #128

Dannnyho opened this issue Apr 18, 2018 · 1 comment

Comments

@Dannnyho
Copy link

Is there any way to edit field editable programmically?
I want to add a "edit" button to enable the all field editable = true

@sambwest
Copy link
Contributor

sambwest commented Jun 1, 2018

Hi,

You can do it by editing the containers state.

constructor(params) {
        super(params);
        this.state = {
            emailEditable: false
        }
    }

Then on the field:

<GiftedForm.TextInputWidget
  name='email'
  title='Email:'
  editable={this.state.emailEditable}
/>

Then in your button:

_toggleEditable() {
  this.setState({emailEditable: !this.state.emailEditable});
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants