From e99941a3eac513df1df7dbeceb640472ef2115bd Mon Sep 17 00:00:00 2001 From: Ignacio Durand Date: Tue, 18 May 2021 18:55:00 -0300 Subject: [PATCH] Adds onPaste validation, fix addition with decimal problem and toPresicion bug - Adds onPaste handler that check if the actual value pasted is a valid Numeric value. - Corrects a bug when adding or subtracting numbers with decimals. - Fix toPresicion fn bug: If the initial value is an integer, it fails to apply toFixed --- src/vue-numeric-input.vue | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/vue-numeric-input.vue b/src/vue-numeric-input.vue index a1643fa..64c332c 100644 --- a/src/vue-numeric-input.vue +++ b/src/vue-numeric-input.vue @@ -15,6 +15,8 @@ @change="onChange" @blur="onBlur" @focus="onFocus" + @paste="onPaste" + @drop.prevent :autofocus="autofocus" :disabled="disabled" :readonly="readonly" @@ -46,6 +48,16 @@