not select all text when user actively selects text

This commit is contained in:
MaysWind
2025-02-19 23:34:38 +08:00
parent f14c283a83
commit 6aac810450
+4 -1
View File
@@ -267,7 +267,10 @@ function onPaste(e: ClipboardEvent): void {
function onClick(e: MouseEvent): void {
if (!props.disabled && !props.readonly && props.modelValue === 0 && e.target instanceof HTMLInputElement) {
const input = e.target as HTMLInputElement;
input?.select();
if ((!input?.selectionStart && !input?.selectionEnd) || input?.selectionStart === input?.selectionEnd) {
input?.select();
}
}
}