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

Feature/maximum and minimum value #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Feature/maximum and minimum value #2

wants to merge 5 commits into from

Conversation

MrZander
Copy link

Added option to put a minimum and maximum value on the input. Should not break any existing code because the properties default to decimal.MinValue and decimal.MaxValue.
Also added a .gitattribute file to fix line ending problems.

@mtusk
Copy link
Owner

mtusk commented Sep 13, 2016

It seems like having a max/min value would be a jarring experience for the user.

Example:

Let's say the maximum value is 10.00 and the user types 1234:

  • 0.01
  • 0.12
  • 1.23
  • 10.00: the user would've expected to see 12.34... they might think they mis-typed the 4 and try again. Also they can't just backspace to try again since the 2 was changed to a 0.

If we instead use validation to show an error if the value is too large then interaction behaves as expected and the user is informed why their value is invalid.

@MrZander
Copy link
Author

I like that idea.
I also noticed it was a little clunky. For example, if you set a minimum of 0 and press '-', it immediately sets the number to 0, which is probably unexpected to the user.

Validation is probably a better way to go.

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.

None yet

2 participants