CraveFood / farmblocks

React components for building web projects.
https://cravefood.github.io/farmblocks/
MIT License
20 stars 5 forks source link

Add mask options for TextInput #443

Closed vNakamura closed 6 years ago

vNakamura commented 6 years ago

Our first requirement is for US phone numbers 999-999-9999, but the component should allow custom masks for other fields and for internationalization.

alcferreira commented 6 years ago

Note: I wasn't able to add a story with a mask because the snapshot test won't work. I've filled this issue https://github.com/sanniassin/react-input-mask/issues/147 to keep track about it.

fczuardi commented 6 years ago

Why not use HTML attributes type="tel" and pattern?

Maybe we could achieve the same results with native behavior + a polyfill for browsers that dont support it. And save us a new react component dependency.

fczuardi commented 6 years ago

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/tel

alcferreira commented 6 years ago

type="tel" only checks if the value entered is valid or not... We actually need to format the value as user types in.