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

NumberFields should allow numbers with decimals to be entered #2214

Closed
1 task
pphillips-fearless opened this issue May 8, 2020 · 0 comments · Fixed by #2219
Closed
1 task

NumberFields should allow numbers with decimals to be entered #2214

pphillips-fearless opened this issue May 8, 2020 · 0 comments · Fixed by #2219
Assignees
Labels
bug needs triage, then squashing Development Issues for the dev team resolve small

Comments

@pphillips-fearless
Copy link
Contributor

Jenn found a bug in #2174 where the FTE field won't let you put in a decimal point. What happens is that the onChange event formats the entry into a number, which strips off leading zeros and trailing decimal points. (fun fact, if you really want a number like 0.6 you can start with 106, make it into 10.6, and remove the leading 1 ... not the best user experience). So when I investigated I realized that the existing FTE field in the State Cost Categories doesn't have that problem because it formats FTE's as a string. But that means that you can put in bad characters like letters and it won't complain.

DollarField has a pretty neat solution for this where it separates out a changeHandler to allow each character as you type it and blurHandler that does the final conversion into a string. To fix this issue, move (or copy) that functionality to NumberField (move as much as possible so as not to have duplicate code, but keep separate whatever DollarField needs to handle it's own unique formatting requirements)

This task is done when...

  • NumberField allows numbers with decimals to be entered
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage, then squashing Development Issues for the dev team resolve small
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants