From 0d9b13f8615dfdd64c90d068925d6d65af54c5a7 Mon Sep 17 00:00:00 2001 From: AriaieBOY Date: Mon, 12 Aug 2024 20:31:11 +0330 Subject: [PATCH] Update currency-mask.blade.php --- resources/views/currency-mask.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/currency-mask.blade.php b/resources/views/currency-mask.blade.php index 7c502e8..65b39dd 100644 --- a/resources/views/currency-mask.blade.php +++ b/resources/views/currency-mask.blade.php @@ -26,7 +26,7 @@ masked:'', init(){ \$nextTick(this.updateMasked()); - \$watch('masked',(value, oldValue)=>this.updateInput(value, oldValue)); + \$watch('masked',(value, oldValue)=>this.updateInput(value,oldValue)); \$watch('input', () => this.updateMasked()); }, updateMasked(){ @@ -37,8 +37,9 @@ } }, updateInput(value, oldValue){ - if(value !== oldValue) + if(value?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.') !== oldValue?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.')){ this.input = this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.'); + } } } JS;