eduardoborges / use-mask-input

✏️ A react Hook for build elegant input masks. Compatible with React Hook Form
https://npmjs.com/package/use-mask-input
336 stars 19 forks source link

Hide the mask #61

Closed eduardodallmannsysmap closed 12 months ago

eduardodallmannsysmap commented 1 year ago

Is there any way to hide the mask and only show it when typing is in the right place?

Example with cleave.js (that's what I want): cleave

With use-mask-input: rut

I want to thank you for the lib. It's perfect.

eduardodallmannsysmap commented 1 year ago

I see #51 issue, but doesn't work. What's wrong?

https://codesandbox.io/s/modern-breeze-3y6tw7

eduardoborges commented 1 year ago

Can you provide more artifacts from your problem? Which mask are u using? Can u show me the code? :D

eduardodallmannsysmap commented 1 year ago

I had previously sent a codesandbox

https://codesandbox.io/s/modern-breeze-3y6tw7

Mateusvaz89 commented 1 year ago

I want to hide the mask too. jitMasking is not working..

eduardoborges commented 1 year ago

@Mateusvaz89 what you mean with "hide the mask"? You can pass a mask with white spaces if you what an "invisible" mask.

eduardodallmann commented 1 year ago

The problem is in this line

https://github.com/eduardoborges/use-mask-input/blob/b4aef47927c2e0ecb2f2d1c926edc4700cb887c7/src/utils/getMaskOptions.ts#L6

It is fixed jitMasking to false

eduardoborges commented 1 year ago

@eduardodallmann uuhh nice catch ⚾️

eduardoborges commented 1 year ago

@Mateusvaz89 i fixed in latest version, can u try it?