Answer the question
In order to leave comments, you need to log in
Why is there a selection in the input when the last character is entered?
When you enter the last character in the input, there is a "self-selection", how to remove it?
<input id="phone" type="text" class="form-control" autofocus autocomplete="off" name="phone" data-mask="+38 (099) 999-99-99" required/>
$("#phone").css("-moz-user-select", "-moz-none");
$("#phone").css("-o-user-select:", "none;");
$("#phone").css("-khtml-user-select", "none");
$("#phone").css("-webkit-user-select", "none");
$("#phone").css("-user-select", "none");
Answer the question
In order to leave comments, you need to log in
I'm posting the solution to the question, as it is quite possible that someone will have such a problem.
It's all about the Masked Input Plugin. When the position matches the length of the mask, the text is highlighted.
Here is this line:
pos == mask.replace("?", "").length ? input.caret(0, pos) : input.caret(pos);
writeBuffer(), input.caret(pos);
You have a piece of code there that just abounds with SelectionRange and textRange. It's hard for me to understand why this piece, but it seems that it is he who makes the selection.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question