not allow to input or paste when amount input is set to readonly or disabled (#36)

This commit is contained in:
MaysWind
2025-01-13 22:03:55 +08:00
parent 9026c526f8
commit a38867ce01
+6 -1
View File
@@ -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;
}