Skip to content

Commit

Permalink
fix #31
Browse files Browse the repository at this point in the history
  • Loading branch information
ariaieboy authored May 30, 2024
1 parent d44c0a7 commit 15f3f76
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions resources/views/currency-mask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,13 @@
init(){
\$nextTick(this.updateMasked());
\$watch('masked',()=>this.updateInput());
\$watch('input', () => this.updateMasked());
},
updateMasked(){
updateMasked(value, oldValue){
if(this.input !== undefined && typeof Number(this.input) === 'number') {
this.masked = this.input?.toString().replaceAll('.','$decimalSeparator');
if(this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.') != this.input){
this.masked = this.input?.toString().replaceAll('.','$decimalSeparator');
}
}
},
updateInput(){
Expand Down

0 comments on commit 15f3f76

Please sign in to comment.