Git Product home page Git Product logo

Comments (6)

rafma0 avatar rafma0 commented on June 2, 2024 2

@Danane84 This feature its not implemented yet, but is a gread idea! I will include in next release.

I didn't do lots of tests but If you pass autoUnmask to inputmask e.g.

{...registerWithMask('cpf', '999.999.999-99', { autoUnmask: true })}

it seems to work flawlessly (you get the unmasked value in onSubmit), even letting me keep my Joi validations for the unmasked values :)

cpf: Joi.string().length(11)

(valeu meu querido por essa lib linda Γ©ssedois)

from use-mask-input.

eduardoborges avatar eduardoborges commented on June 2, 2024

Hey @Danane84 !
You want something like that?

from use-mask-input.

Danane84 avatar Danane84 commented on June 2, 2024

Exactly :)) Thanks a lot for your quick response!

Three more questions:
1.) Is there an option to allow only positive values, so basically not allow any "-" input?
2.) Is there an option to control the text-direction? Currently the text in the input is shown from-right-to-left by default, but I would like to have it from-left-to-right. I tried dir="ltr" and className="text-left" but neither did the trick.
3.) Is there an option to limit the numbers before the decimal, eg. to allow only numbers with 7 digits like 9 999 999.00 but not with 8 digits like 10 000 000.00

Thanks again

from use-mask-input.

eduardoborges avatar eduardoborges commented on June 2, 2024

@Danane84 Of course its possibel all this items.

  1. just pass allowMinus option to false;
  2. set rightAlign to false
  3. just set the max to 9999999

Tell me if worked for you. <3

from use-mask-input.

Danane84 avatar Danane84 commented on June 2, 2024

That's awesome, it works like a charm! One last question: Is it possible to pass the unmasked instead of the masked value to the data-props of the onSubmit-function? Currently, I can only see the masked value in data but would need the unmasked one for backend-submission.

from use-mask-input.

eduardoborges avatar eduardoborges commented on June 2, 2024

@Danane84 This feature its not implemented yet, but is a gread idea! I will include in next release.

from use-mask-input.

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.