Skip to content

Commit

Permalink
fix issue #39
Browse files Browse the repository at this point in the history
  • Loading branch information
ariaieboy committed Aug 12, 2024
1 parent c800e5a commit d7dec32
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions resources/views/currency-mask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d7dec32

Please sign in to comment.