From 6aac810450b5a79aa1b0c5ffa046d24d197fa1a2 Mon Sep 17 00:00:00 2001 From: MaysWind Date: Wed, 19 Feb 2025 23:34:38 +0800 Subject: [PATCH] not select all text when user actively selects text --- src/components/desktop/AmountInput.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/desktop/AmountInput.vue b/src/components/desktop/AmountInput.vue index a1d3d0d9..14969d02 100644 --- a/src/components/desktop/AmountInput.vue +++ b/src/components/desktop/AmountInput.vue @@ -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(); + } } }