notchris / payload-mask-plugin

An input mask plugin for Payload
https://www.npmjs.com/package/payload-mask-plugin
MIT License
5 stars 0 forks source link

Ability to store the unmasked value #3

Closed mfilteau closed 1 month ago

mfilteau commented 2 months ago

I have a phone number field with the following mask '(000) 000-0000'.

The IMaskInput component has an option to store the unmasked value (unmask) but this option is not available.

It would be nice to store values that don't have to be formatted later on.

notchris commented 2 months ago

@mfilteau I believe it does save the unmasked value to the record. Are you saying it would be nice to store the masked value "(000) 000-0000"? I could add a "saveMaskedValue" option?

Screenshot 2024-07-15 at 1 49 08 PM Screenshot 2024-07-15 at 1 49 15 PM
mfilteau commented 2 months ago

The saveMaskedValue option would be great. Saving the masked value (instead of the 'unmasked' value) makes life easier later on when the field needs to be displayed or used.

notchris commented 1 month ago

@mfilteau This should work as an option now!