How to use the react-text-mask.conformToMask function in react-text-mask

To help you get started, we’ve selected a few react-text-mask examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github catho / quantum / components / TextMask / TextMask.jsx View on Github external
render() {
    const { children, text, mask } = this.props;
    const input = text || children;

    return mask ? conformToMask(input, mask).conformedValue : input;
  }
}
github redgeoff / mson-react / src / mson / fields / text-field.js View on Github external
_conformToMask(value, mask) {
    var conformed = conformToMask(value, mask, {
      guide: false
    });
    return conformed.conformedValue;
  }
github htmlburger / carbon-fields / assets / js / fields / validators / masked.js View on Github external
export function handler(field) {
	const { mask, value, maskPlaceholder } = field;
	const result = conformToMask(value, mask, { placeholderChar: maskPlaceholder });
	if ( result.conformedValue.indexOf(maskPlaceholder) > -1 ) {
		return carbonFieldsL10n.field.wrongMask;
	}

	return null;
}

react-text-mask

React input component that accepts mask pattern

Unlicense
Latest version published 2 years ago

Package Health Score

62 / 100
Full package analysis