Comments (6)
@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.
Hey @Danane84 !
You want something like that?
from use-mask-input.
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.
@Danane84 Of course its possibel all this items.
- just pass
allowMinus
option tofalse
; - set
rightAlign
tofalse
- just set the
max
to9999999
Tell me if worked for you. <3
from use-mask-input.
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.
@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)
- Unnecessary dependency (react-hook-form)? HOT 1
- Thanks for this package! π π HOT 2
- TypeError: Inputmask is not a function HOT 9
- Missing type=module in package.json HOT 11
- Destructing isDirty from formState causing error with cursor-position in masked input HOT 5
- error during installation HOT 2
- 'Usage with React Hook Forms' correction HOT 1
- Remove 'mask trace' HOT 3
- Still don't get auto completion for options after last update (?) HOT 2
- docs: datetime year autofill disable
- removeMaskOnSubmit doesn't seem to work on react-hook-form HOT 1
- Integrate with react-hook-form `control` HOT 3
- Accessing unmasked value from event
- Hide the mask HOT 8
- Using controlled component causes strange behavior HOT 3
- Dynamic mask HOT 1
- Component unmount HOT 2
- Failed to resolve entry for package. HOT 7
- next.js - self is not defined HOT 12
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 use-mask-input.