maska icon indicating copy to clipboard operation
maska copied to clipboard

Option to 'reverse' the order in which the mask applies

Open timbaas opened this issue 3 years ago • 7 comments

As far as I've seen the mask currently always applies from left to right on the characters. The mask #,### would give 1, then 1,0, then 1,00 and finally 1,000 when a user enters 1000.

I need users to input very large numbers (9+ digit ints) so for me the comma to seperate thousands is very important. If I could reverse the interpretation it would give: 1, then 10, then 100, then 1,000.

I can add it and create a PR if you like?

timbaas avatar May 16 '21 17:05 timbaas

Do you want to add new option to reverse mask, something like this?

<input v-maska="{ mask: '#,###', reverse: true }">

beholdr avatar May 17 '21 08:05 beholdr

👍🏽 need this as well, very useful for things like height, weight, ...

augustnmonteiro avatar May 19 '21 19:05 augustnmonteiro

This worked for me, for the reverse option

<input v-maska="{ mask: '[ "#,###,###,###.##" , "###,###,###.##" , "##,###,###.##" , "#,###,###.##" , "###,###.##" , "##,###.##" , "#,###.##" , "###.##" , "##.##" , "#.##" ]' }">
<input v-maska="{ mask: '[ "#,###.##" , "###.##" , "##.##" , "#.##" ]' }">

...

bayalad7 avatar May 20 '21 06:05 bayalad7

Do you want to add new option to reverse mask, something like this?

<input v-maska="{ mask: '#,###', reverse: true }">

This will be very usefull

brokieb avatar Jun 19 '21 20:06 brokieb

Also need this.

dixhuit avatar Feb 27 '22 22:02 dixhuit

another one in need, a must have for masking

douglasjam avatar Mar 27 '22 21:03 douglasjam

+1

imaxsof avatar Sep 22 '22 18:09 imaxsof

Same

25Das avatar Dec 03 '22 05:12 25Das

Implemented in v2

beholdr avatar Dec 04 '22 15:12 beholdr