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

[FormsyText] New implementation to allow initialization through this.refs.form.reset #19

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

vijayrawatsan
Copy link
Contributor

Based on https://github.com/christianalfoni/formsy-react/wiki/validate-on-blur

Hi @mbrookes
Apologies for the bad jsx file. I indeed copied it from index.js instead of doing it the other way.
I have compiled jsx on https://babeljs.io/repl

This time I have also created a demo video for you to check out the behaviour of TextField.

Do let me know if it fixes #6 or not.

ScreenShot

https://youtu.be/bs56hnZozZU

Note : When ever an error comes in the video without any reason that means I have clicked enter key.

Thanks

@mbrookes
Copy link
Collaborator

mbrookes commented Nov 2, 2015

  1. Are you editing the code directly on github? - not really a good idea for code changes, as errors are likely (like yesterday's ;) It also means I can't merge from your fork to test locally.
  2. Use babel <infile> -o <outfile>, as per the prepublish hook in package.json.
  3. Please refer to the discussion in [FormsyText] Validating onBlur doesn't enable the submit button if this is the last field before submit. #6. Enter key support is useful, but doesn't solve the fundamental problem with onBlur. (I'm not asking you to solve it with this PR, just saying this doesn't entirely 😄)

@vijayrawatsan
Copy link
Contributor Author

  1. Nope. But I am working on your github repo directly by creating new branches, and then making pull request with master on github.
  2. I know about babel -o . Will keep that in mind. But I think https://babeljs.io/repl also does the same thing.
  3. Assuming you are talking about below problem from [FormsyText] Validating onBlur doesn't enable the submit button if this is the last field before submit. #6
    "If a user fills out a textfield as the last required input, with onBlur the submit button isn't enabled unless the user clicks away from the field. With onChange this problem would likely be resolved."

In my implementation as soon as input field becomes valid the submit button gets enabled. (during onChange itself) but error comes only if onBlur or onEnterKey press which feels very natural.

Please let me know if this pr is ready for merge or do you want me to improve something :)

@mbrookes
Copy link
Collaborator

mbrookes commented Nov 2, 2015

Nope. But I am working on your github repo directly by creating new branches, and then making pull request with master on github.

Ah, sorry - missed that. I'd prefer if you edit your own fork and PR from there.

I think https://babeljs.io/repl also does the same thing.

Yes, but copying and pasting is error prone, as you discovered. 😉 Not sure why you would use that when you can run babel locally in your branch.

In my implementation as soon as input field becomes valid the submit button gets enabled.

Yes, that sounds ideal. It wasn't obvious from the video.

Testing your branch now.

@mbrookes mbrookes changed the title FormstText implementation based on FormstText implementation based on #12 Nov 2, 2015
@mbrookes mbrookes changed the title FormstText implementation based on #12 [FormsyText] New implementation to allow initialization through this.refs.form.reset Nov 2, 2015
mbrookes pushed a commit that referenced this pull request Nov 2, 2015
Supports texfield initialization through this.refs.form.reset & addresses #6 as a byproduct.
@mbrookes mbrookes merged commit 67cc4c5 into master Nov 2, 2015
@mbrookes
Copy link
Collaborator

mbrookes commented Nov 2, 2015

Merged and published. Thanks!! 👌

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

Successfully merging this pull request may close these issues.

[FormsyText] Validating onBlur doesn't enable the submit button if this is the last field before submit.
2 participants