perf(input-number): when zero is entered, value displayed isn't expected
parent
60b3806dab
commit
44dd8cd329
|
@ -870,7 +870,8 @@ export default {
|
||||||
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd);
|
||||||
} else if (newLength === currentLength) {
|
} else if (newLength === currentLength) {
|
||||||
if (operation === 'insert' || operation === 'delete-back-single') {
|
if (operation === 'insert' || operation === 'delete-back-single') {
|
||||||
const newSelectionEnd = selectionEnd + Number(this.isDecimalSign(value) || this.isDecimalSign(insertedValueStr));
|
const re = /[.,]/g;
|
||||||
|
const newSelectionEnd = selectionEnd + Number(re.test(value) || re.test(insertedValueStr));
|
||||||
|
|
||||||
this.$refs.input.$el.setSelectionRange(newSelectionEnd, newSelectionEnd);
|
this.$refs.input.$el.setSelectionRange(newSelectionEnd, newSelectionEnd);
|
||||||
} else if (operation === 'delete-single') {
|
} else if (operation === 'delete-single') {
|
||||||
|
|
Loading…
Reference in New Issue