Fixed #7110 - InputMask: Problem with input prompt cursor on Windows

pull/7129/head
tugcekucukoglu 2025-01-21 13:35:56 +03:00
parent 8cf1b0596b
commit 9d9de4f0fd
1 changed files with 20 additions and 16 deletions

View File

@ -79,27 +79,31 @@ export default {
}
this.focus = true;
clearTimeout(this.caretTimeoutId);
let pos;
this.focusText = this.$el.value;
pos = this.checkVal();
if (!this.$el.value || this.$el.value === this.defaultBuffer) {
requestAnimationFrame(() => {
if (this.$el === document.activeElement) {
this.caret(0, 0);
}
});
} else {
let pos = this.checkVal();
this.caretTimeoutId = setTimeout(() => {
if (this.$el !== document.activeElement) {
return;
}
this.caretTimeoutId = setTimeout(() => {
if (this.$el !== document.activeElement) {
return;
}
this.writeBuffer();
this.writeBuffer();
if (pos === this.mask.replace('?', '').length) {
this.caret(0, pos);
} else {
this.caret(pos);
}
}, 10);
if (pos === this.mask.replace('?', '').length) {
this.caret(0, pos);
} else {
this.caret(pos);
}
}, 10);
}
this.$emit('focus', event);
},