-
-
Notifications
You must be signed in to change notification settings - Fork 159
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: enforce number data type for number input (#291) #315
Conversation
thanks for the contribution 🙇 I will review it soon when I have some time. |
sorry for the delay, I've not had the time yet. I haven't forgotten about this though. |
@raychanks hey again sorry for taking so long. Seems to solve the issue with an empty input so for the related issue its successful. The only other thing I noted is that with invalid values the value becomes NaN. Is that what we want? I'm ok with it just wondering what you think about it. |
@dannyhw sorry for the late reply. I think that invalid values should be passed in as I am thinking about the use case that the user wants to input a negative number. The normal flow would be clearing the input field first, then input the |
@raychanks I think when its Sorry it took so long to get this merged, I've just started a new job and so I have had less time recently. |
I was trying to rebase this and I totally screwed up the entire thing 😩. |
@raychanks hey I was just checking this one more time and the problem is that the reset doesn't work since the state of 'numStr' is not consistent with the arg state. Not really sure what the right move is with this now honestly. I'll think on it. |
@dannyhw no worries, best of luck to your new role. Not sure whether a -1 is appropriate, the user might find it more difficult to input other negative numbers like -2. As soon as the user tries to delete the 1 from -1, the input will immediately restore to -1. Nice catch on the reset bug, I will try to figure out a solution too. |
@raychanks thanks for the kind words :) in this case the -1 was only set to the Args not to the local state so it didn't effect the typing of the number. Feel free to adjust it though and handle in another way 🙂 |
@dannyhw you're right about the -1 case. I added a |
@raychanks interesting change, I'll give it a try later. Looks good though! |
@raychanks this is working great! Great job 🎉 . Really appreciate your help, and I'm sorry again for taking so long to get to it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 🚀
Great work!
published this change on 6.0.1-beta.3 |
Issue: #291
What I did
Enforce number data type for number input
How to test
Please explain how to test your changes and consider the following questions
Some cases to consider:
No
No
If your answer is yes to any of these, please make sure to include it in your PR.