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

TextField component doesn't know when input element has value and moves label incorrectly back into input field area #41

Open
SgtPooki opened this issue Aug 21, 2017 · 1 comment

Comments

@SgtPooki
Copy link

I feel like I should be able to use a Textfield component without having to save state and manage onclick and other values.. something like

<Textfield name="EMAIL" floatingLabel="Your email" />

and have it work properly as an input element would. However, react-mdc-web textfield components seem to require a 'value' element to be passed to recognize whether state has changed or not.

I believe this should be easily inferable from the contents of the native input element.

You seem to currently only be getting the value of the input element from props, which means you're tightly coupled to the state management and rendering tree of parent elements. As a styling sort of framework, I was expecting that you would work as a more native sort of element.

It looks like just a few tweaks to https://github.com/kradio3/react-mdc-web/blob/master/src/Textfield/Textfield.js#L48-L50 and https://github.com/kradio3/react-mdc-web/blob/master/src/Textfield/Textfield.js#L61-L74 should solve this issue for any future users...

Would you accept a pull request resolving this issue so that it still works as it does but also works as a more self-contained native component as well?

@kradio3
Copy link
Owner

kradio3 commented Aug 21, 2017

Sure, would be great

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