From d7dec32ed7d560ced5c78db8ae9e19886256aad3 Mon Sep 17 00:00:00 2001 From: AriaieBOY Date: Mon, 12 Aug 2024 11:55:51 +0330 Subject: [PATCH] fix issue #39 --- resources/views/currency-mask.blade.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/views/currency-mask.blade.php b/resources/views/currency-mask.blade.php index 9e305cb..169bee6 100644 --- a/resources/views/currency-mask.blade.php +++ b/resources/views/currency-mask.blade.php @@ -29,15 +29,16 @@ \$watch('masked',()=>this.updateInput()); \$watch('input', () => this.updateMasked()); }, - updateMasked(value, oldValue){ + updateMasked(){ if(this.input !== undefined && typeof Number(this.input) === 'number') { if(this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.') !== this.input){ this.masked = this.input?.toString().replaceAll('.','$decimalSeparator'); } } }, - updateInput(){ - this.input = this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.'); + updateInput(value, oldValue){ + if(value !== oldValue) + this.input = this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.'); } } JS;