Comments (5)
Implementation doesn't look too hard. But I have objection how it should work.
For example you set min value to 1234,12345
. Now user want to type value 99
. To do this he type first number 9
. Directive doesn't know when value is typed, it just checks actual value. Therefore it checks if value 9
is bigger then min value. And it isn't. What then? Less problematic is max value but I also see UX problems.
from react-dynamic-number.
Maybe we could start with just adding the max value feature for positive numbers, and a min value feature for negative values.
from react-dynamic-number.
But as I wrote above, max value also has some controversies. For example if max value is 999.99999 and user want write 111 but by mistake write 1111 then it will change his value to 999.9999 and he need to remove it totally. Max and min value are cool when user writes value and then for example presses submit button. Not when he dynamically write it.
But this is my opinion. If you will write some accurate arguments then very likely you will convince me. Because I try to make this modules as good as possible (taking into account my free time :) )
from react-dynamic-number.
+1 for max
from react-dynamic-number.
I think, that min, max is solely the validation concern, so it should not be solved in this way. The validation is a business logic - specific concern and should be handled by your application. Usually, it involves adding "visited" boolean flag, which indicates whether your control has been touched by user input or not. And the validation is executed in onBlur event and explicitly, when user saves the form.
from react-dynamic-number.
Related Issues (20)
- allow set strategies
- check what if we pass float value and in props we set thousand with dot HOT 2
- add defaultValue prop HOT 1
- Duplicate module name: ViewportMetrics HOT 2
- ES5 support HOT 3
- Add id value HOT 4
- Empty initial values when using comma as decimal separator HOT 5
- Unable to get property 'separator' of undefined (IE 10)
- move react to peerDependencies HOT 2
- PlaceHolder Values HOT 2
- Refs Problem HOT 1
- Add focus support HOT 6
- Fraction is error HOT 3
- Unable to focus using ref HOT 3
- Allow for dot character thousands seperator
- React 16 Warning HOT 3
- Support event onBlur, onFocus, onKeypress
- Support for unicode numerals
- mber input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-dynamic-number.