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 May 30, 2024
1 parent a665863 commit 0fa7ade
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions resources/views/currency-mask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@
input:\$wire.{$applyStateBindingModifiers("\$entangle('{$statePath}')")},
masked:'',
init(){
\$nextTick(this.updateMasked());
\$watch('masked',()=>this.updateInput());
\$watch('input',()=>this.updateMasked());
\$nextTick(this.updateMasked());
\$watch('masked',()=>this.updateInput());
},
updateMasked(){
if(this.input !== undefined && typeof Number(this.input) === 'number' && (\$data && \$data.input)) {
if(this.input !== undefined && typeof Number(this.input) === 'number') {
this.masked = this.input?.toString().replaceAll('.','$decimalSeparator');
\$el.dispatchEvent(new Event('input'));
}
},
updateInput(){
Expand Down

0 comments on commit 0fa7ade

Please sign in to comment.