Yet another React component for input masking with attention to small usability details with cursor position, copy-paste, etc.
http://codepen.io/anon/pen/LVLKPR
Mask string. Format characters are:
9
: 0-9
a
: A-Z, a-z
*
: A-Z, a-z, 0-9
Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. For example, German phone mask with unremoveable prefix +49 will look like "+4\\9 99 999 99"
Character to cover unfilled editable parts of mask. Default character is "_"
var PhoneInput = React.createClass({
render: function() {
return <InputElement {...this.props} mask="+4\\9 99 999 99" maskChar=" "/>;
}
});