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

Focus lost on redux form input #481

Closed
JensDebergh opened this issue Dec 29, 2015 · 5 comments
Closed

Focus lost on redux form input #481

JensDebergh opened this issue Dec 29, 2015 · 5 comments

Comments

@JensDebergh
Copy link

I'm using redux-form for a simple registration form. I've run into this issue where redux does in fact store the state changes of the input field, but it keeps losing focus on key enter.
This means I'm only able to input 1 letter at a time before losing focus on that element.

Any idea how or why this happens?
Could this have something to do with following warning:

screen shot 2015-12-29 at 10 22 28

Code snippet: https://github.com/JensDebergh/toggle-client/blob/j-toker-login/app/containers/RegistrationPage.js

@erikras
Copy link
Member

erikras commented Dec 30, 2015

Can you share the JSX where the inputs are?

@JensDebergh
Copy link
Author

Sorry for not responding on this sooner. I've found the problem.

The problem was that I passed down the entire state of the redux store as props out of "laziness". Which resulted in redux having problems with props validation on the form object.

I slimmed down the props I needed just for the form and it worked as intended.

@waffleau
Copy link

waffleau commented Feb 4, 2016

@JensDebergh thanks for replying with your solution, you've just saved me a lot of effort! People like you that respond with solutions for your own problems are what give me faith in humanity. =p

@rndstr
Copy link

rndstr commented May 11, 2016

A hero, indeed. Some more information (for the novice like myself):

I changed

export default connect(state => state)(form(MyFormPage));

into

export default connect(state => state.form.myformlabel)(form(MyFormPage));

This also fixed an issue for me where the input field was losing its value upon blur.

Here the error message as text:

Warning: Failed propType: Invalid prop `form` of type `object` supplied to `ReduxFormConnector(MyFormPage)`, expected `string`. Check the render method of `ConnectedForm`.

@lock
Copy link

lock bot commented Jun 3, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants