Skip to content

Commit

Permalink
Update currency-mask.blade.php
Browse files Browse the repository at this point in the history
  • Loading branch information
ariaieboy authored Aug 12, 2024
1 parent 0ba7e0e commit 0d9b13f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions resources/views/currency-mask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand All @@ -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;
Expand Down

0 comments on commit 0d9b13f

Please sign in to comment.