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

Documentation on submitting and resetting a form #222

Closed
tschaub opened this issue Jan 9, 2015 · 6 comments
Closed

Documentation on submitting and resetting a form #222

tschaub opened this issue Jan 9, 2015 · 6 comments
Labels
component: FormControl The React component

Comments

@tschaub
Copy link
Contributor

tschaub commented Jan 9, 2015

It looks like input.getValue and input.clearValue were removed in e7d36f6 but they are still documented as methods for working with Input components.

I'd be happy to help update the documentation if someone can give a good example of submitting and resetting forms that use Input elements. I was previously using getValue on submit and clearValue on reset.

@geekingfrog
Copy link
Contributor

I believe these methods should be put back, or the project need to do a major version bump since this clearly break the API and will make some code backward incompatible.

@tschaub in the meantime you can use this.refs.myInput.setState({value: ''}) to clear the input and similarly use the state to get the value.

@hai-cea
Copy link
Member

hai-cea commented Jan 14, 2015

@tschaub @geekingfrog - Yeh I agree with you both. I think these methods should be put back.

@dcsan
Copy link

dcsan commented Dec 21, 2015

old issue, but can someone give an example how to use these methods?

It seems like maybe the input component no longer exists, but perhaps these methods work for textfields?

related
#2615

@oliviertassinari
Copy link
Member

Imperative method are going to be removed from this repository. Use the property API instead.

brianfeister pushed a commit to brianfeister/material-ui that referenced this issue May 1, 2017
@sandorvasas
Copy link

sandorvasas commented Jun 6, 2017

too bad. makes creating forms a pain. why do you drop basic html, html5 features in favor of something more complex? stepping backwards. apis, libs should ease and simplify development. also input types url, phone, email (and others) are built-in in html5, but with material-ui we're back to manually validating them? what the heck..

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 6, 2017

Those helpers have been replaced on the next branch by the inputRef callback property so users can directly access the input dom element.

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

No branches or pull requests

7 participants