From a38867ce016911bd15ae65adcf58da4be94ffbcd Mon Sep 17 00:00:00 2001 From: MaysWind Date: Mon, 13 Jan 2025 22:03:55 +0800 Subject: [PATCH] not allow to input or paste when amount input is set to readonly or disabled (#36) --- src/components/desktop/AmountInput.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/desktop/AmountInput.vue b/src/components/desktop/AmountInput.vue index 3889495b..b0a0cd1d 100644 --- a/src/components/desktop/AmountInput.vue +++ b/src/components/desktop/AmountInput.vue @@ -140,6 +140,11 @@ function onKeyUpDown(e: KeyboardEvent): void { return; } + if (props.readonly || props.disabled) { + e.preventDefault(); + return; + } + const digitGroupingSymbol = getCurrentDigitGroupingSymbol(); const decimalSeparator = getCurrentDecimalSeparator(); @@ -235,7 +240,7 @@ function onKeyUpDown(e: KeyboardEvent): void { } function onPaste(e: ClipboardEvent): void { - if (!e.clipboardData) { + if (!e.clipboardData || props.readonly || props.disabled) { e.preventDefault(); return; }