Fixed #453 - Can't type - as first symbol into an Inputnumber
parent
19252e6b68
commit
91ebe9dd66
|
@ -165,6 +165,10 @@ export default {
|
||||||
},
|
},
|
||||||
formatValue(value) {
|
formatValue(value) {
|
||||||
if (value != null) {
|
if (value != null) {
|
||||||
|
if (value === '-') { // Minus sign
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
if (this.format) {
|
if (this.format) {
|
||||||
let formatter = new Intl.NumberFormat(this.locale, this.getOptions());
|
let formatter = new Intl.NumberFormat(this.locale, this.getOptions());
|
||||||
let formattedValue = formatter.format(value);
|
let formattedValue = formatter.format(value);
|
||||||
|
@ -196,6 +200,9 @@ export default {
|
||||||
.replace(this._numeral, this._index);
|
.replace(this._numeral, this._index);
|
||||||
|
|
||||||
if (filteredText) {
|
if (filteredText) {
|
||||||
|
if (filteredText === '-') // Minus sign
|
||||||
|
return filteredText;
|
||||||
|
|
||||||
let parsedValue = +filteredText;
|
let parsedValue = +filteredText;
|
||||||
return isNaN(parsedValue) ? null : parsedValue;
|
return isNaN(parsedValue) ? null : parsedValue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue