Fixed #5545 - InputNumber Not Working android
parent
6004166df9
commit
1d9c036f31
|
@ -10,6 +10,7 @@
|
|||
:aria-valuemin="min"
|
||||
:aria-valuemax="max"
|
||||
:aria-valuenow="modelValue"
|
||||
:inputmode="mode === 'decimal' && !minFractionDigits ? 'numeric' : 'decimal'"
|
||||
:disabled="disabled"
|
||||
:readonly="readonly"
|
||||
:placeholder="placeholder"
|
||||
|
@ -18,6 +19,7 @@
|
|||
:aria-invalid="invalid || undefined"
|
||||
@input="onUserInput"
|
||||
@keydown="onInputKeyDown"
|
||||
@keypress="onInputKeyPress"
|
||||
@paste="onPaste"
|
||||
@click="onInputClick"
|
||||
@focus="onInputFocus"
|
||||
|
@ -525,22 +527,25 @@ export default {
|
|||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
},
|
||||
onInputKeyPress(event) {
|
||||
if (this.readonly) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.preventDefault();
|
||||
|
||||
let char = event.key;
|
||||
const isDecimalSign = this.isDecimalSign(char);
|
||||
let isDecimalSign = this.isDecimalSign(char);
|
||||
const isMinusSign = this.isMinusSign(char);
|
||||
|
||||
if (event.code !== 'Enter') {
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if ((Number(char) >= 0 && Number(char) <= 9) || isMinusSign || isDecimalSign) {
|
||||
this.insert(event, char, { isDecimalSign, isMinusSign });
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
},
|
||||
onPaste(event) {
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue