Alpine.js Mask Money masking with unexpected behavior #4115
-
Hello guys. I'm facing an issue with alpinejs money mask. This issue can be reproduceed on the official alpinejs plugin page, so a replication repository is not necessary, right? Instead, I'll drop the link for the specific session on the official docs, where the issue can be verified: https://alpinejs.dev/plugins/mask#money-inputs The issue is: every field with money mask input is including 3 precision digits on the mask, while the expected behaviour is 2 digits by default. Even with a explicit declaration for 2 precision digits on the $money contructor, results in a mask with 3 precision digits. Screenshot from the official plugin: 3 precision digits, while the expected is 2 (by default): 3 precision digits, while the expected is 4 (explicit on the constructor): Maybe I have misunderstooded something on the way, but I actually analyzed everything several times before coming here for help. Thanks in advance! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
That one is the thousands separator not the decimal one. |
Beta Was this translation helpful? Give feedback.
-
@docdunning Got it. There is no mention of this on documentation. If I need to place the decimal point manually, it doesn't make much sense to use a mask in this case. However, you made me understand what is happening, and that is enough to move forward with an alternative. Thank you for your patience and help. |
Beta Was this translation helpful? Give feedback.
You need to explicitly enter a decimal point. If you just enter some digits, you'll get the thousands separator but nothing else.