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

Fix number inputs #333

Merged
merged 2 commits into from
Jun 1, 2018
Merged

Fix number inputs #333

merged 2 commits into from
Jun 1, 2018

Conversation

sindresorhus
Copy link
Contributor

@sindresorhus sindresorhus commented May 30, 2018

Basically, React is totally broken when it comes to number inputs. The fix is to just use normal string based inputs. I also added some validation for number inputs.

I also changed the withdraw modal to use separate states for the amount and the amount in USD. That's the only way to make it work.

tl;dr Numbers are hard

Basically, React is just broken when it comes to number inputs. The fix is to just use normal string based inputs. I also added some validation for number inputs.
@lukechilds
Copy link
Member

Sorry, accidental close.

When I checkout this branch I can't log in. As soon as I enter a char for my password it sets the input value as NaN. Slight inconvenience 😉

@sindresorhus
Copy link
Contributor Author

When I checkout this branch I can't log in. As soon as I enter a char for my password it sets the input value as NaN. Slight inconvenience 😉

Oops, fixed.

@sindresorhus sindresorhus merged commit e5be665 into master Jun 1, 2018
@sindresorhus sindresorhus deleted the fix-number-inputs branch June 1, 2018 10:42
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.

2 participants