insin / inputmask-core

Standalone input mask implementation, independent of any GUI
MIT License
304 stars 52 forks source link

Question: Any reason why blank placeholderChar not supported? #14

Open mdgbayly opened 8 years ago

mdgbayly commented 8 years ago

I was trying to use the react-maskedinput library to handle entering percentages with a mask like: '111%'. Ideally I'd like to not have any placeholderChar because 9% and 99% would both be valid values too.

I tried setting the DEFAULT_PLACEHOLDER_CHAR = '' and commenting out the validation error in InputMask.

Seems to work ok for my pattern but wondering if this will likely cause issues for other patterns?

NickGard commented 7 years ago

@mdgbayly, with regards to your comment:

Seems to work ok for my pattern but wondering if this will likely cause issues for other patterns?

My opinion is that it is up to the consumer to set a placeholderChar that looks good with their pattern, it is not up to the library to restrict placeholderChars on the off-chance that it may not look good.