not allow to input or paste when amount input is set to readonly or disabled (#36)
This commit is contained in:
@@ -140,6 +140,11 @@ function onKeyUpDown(e: KeyboardEvent): void {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (props.readonly || props.disabled) {
|
||||||
|
e.preventDefault();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const digitGroupingSymbol = getCurrentDigitGroupingSymbol();
|
const digitGroupingSymbol = getCurrentDigitGroupingSymbol();
|
||||||
const decimalSeparator = getCurrentDecimalSeparator();
|
const decimalSeparator = getCurrentDecimalSeparator();
|
||||||
|
|
||||||
@@ -235,7 +240,7 @@ function onKeyUpDown(e: KeyboardEvent): void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function onPaste(e: ClipboardEvent): void {
|
function onPaste(e: ClipboardEvent): void {
|
||||||
if (!e.clipboardData) {
|
if (!e.clipboardData || props.readonly || props.disabled) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user