Skip to content

Commit f80b31e

Browse files
committed
Handle case where focus is quickly removed.
Couldn’t use `:focus` because of some issues with phantomjs. :( Closes #232
1 parent 6efbf8a commit f80b31e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/jquery.maskedinput.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,9 @@ $.fn.extend({
398398
pos = checkVal();
399399

400400
caretTimeoutId = setTimeout(function(){
401+
if(input.get(0) !== document.activeElement){
402+
return;
403+
}
401404
writeBuffer();
402405
if (pos == mask.replace("?","").length) {
403406
input.caret(0, pos);

0 commit comments

Comments
 (0)