react-input-mask
react-input-mask copied to clipboard
onChange is fired when the input is completed and keeping typing
When the input (mask) is completed and you are keeping typing, onChange event is triggered. It shuldn't, because the actual value is not changing.
Что до сих пор нет ответа ?? 😑
Решил таким вот способом:
const completeChange = (e: any) => {
if (e.target.value.replace(/\D/g, "").length == 11) {
e.preventDefault();
return false;
}
};
<TextField
onKeyDown={(e: any) => {
completeChange(e)
}}