From a7c3110a4e6c72c227320bb52eeed4aa306848eb Mon Sep 17 00:00:00 2001 From: mertsincan Date: Tue, 7 Sep 2021 17:28:08 +0300 Subject: [PATCH] Refactor #1513 --- src/components/inputnumber/InputNumber.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/inputnumber/InputNumber.vue b/src/components/inputnumber/InputNumber.vue index bb40936f1..ab4efb1a9 100755 --- a/src/components/inputnumber/InputNumber.vue +++ b/src/components/inputnumber/InputNumber.vue @@ -852,7 +852,10 @@ export default { this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd); } else if (inputValue === '-' && operation === 'insert') { - this.$refs.input.$el.setSelectionRange(selectionEnd + 1, selectionEnd + 1); + this.$refs.input.$el.setSelectionRange(0, 0); + const index = this.initCursor(); + const selectionEnd = index + insertedValueStr.length + 1; + this.$refs.input.$el.setSelectionRange(selectionEnd, selectionEnd); } else { selectionEnd = selectionEnd + (newLength - currentLength);