Code Monkey home page Code Monkey logo

Comments (5)

uhlryk avatar uhlryk commented on July 17, 2024

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.

andylhansen avatar andylhansen commented on July 17, 2024

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.

uhlryk avatar uhlryk commented on July 17, 2024

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.

ariesjia avatar ariesjia commented on July 17, 2024

+1 for max

from react-dynamic-number.

alexf2 avatar alexf2 commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.