Skip to content

Commit

Permalink
Merge pull request #29 from nielsvh2103/main
Browse files Browse the repository at this point in the history
Fix issue in repeater when input is undefined or 0
  • Loading branch information
ariaieboy committed May 30, 2024
2 parents 1d7884b + 63068f8 commit 3986a2b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions resources/views/currency-mask.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +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());
\$watch('input',()=>this.updateMasked());
},
updateMasked(){
if(typeof Number(this.input) === 'number'){
if(this.input !== undefined && typeof Number(this.input) === 'number' && (\$data && \$data.input)) {
this.masked = this.input?.toString().replaceAll('.','$decimalSeparator');
\$el.dispatchEvent(new Event('input'));
}
Expand Down

0 comments on commit 3986a2b

Please sign in to comment.