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

How to control text inside Form.Input (like grabbing and clearing after submit)? #1520

Closed
zarnihpyoe opened this issue Mar 28, 2017 · 5 comments
Labels

Comments

@zarnihpyoe
Copy link

I don't see any props and example of controlling text inside Form.Input in the documentation . It'd be great if there's an example in documentation.

@levithomason
Copy link
Member

Vanilla React input

<input value='I am read only' />
<input defaultValue='I am editable' />

Semantic UI React Input

<Input value='I am read only' />
<Input defaultValue='I am editable' />

Shorthand Form.Input

<Form.Input value='I am read only' />
<Form.Input defaultValue='I am editable' />

@levithomason
Copy link
Member

Because our components are inline with vanilla React behavior, you can refer to React's docs for more info on how to work with Forms:

https://facebook.github.io/react/docs/forms.html#controlled-components

@zarnihpyoe
Copy link
Author

Thanks levi. That helps a lot.

@levithomason
Copy link
Member

I'm adding detailed usage examples for both these cases as well. You can see them here for now:

https://github.com/Semantic-Org/Semantic-UI-React/pull/1521/files

@filipetedim
Copy link

As per this issue here: Semantic-Org/Semantic-UI#1870 , the default option where you can't edit values should not appear as editable, as it may confuse users.

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

No branches or pull requests

3 participants