From c768f030cbe1c07019ed6303497c11ce6bd4d01b Mon Sep 17 00:00:00 2001 From: AriaieBOY Date: Sat, 14 Oct 2023 15:36:15 +0330 Subject: [PATCH] fix nullable input --- resources/views/currency-mask.blade.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/views/currency-mask.blade.php b/resources/views/currency-mask.blade.php index 9f806f0..04ab9a8 100644 --- a/resources/views/currency-mask.blade.php +++ b/resources/views/currency-mask.blade.php @@ -20,11 +20,11 @@ input:\$wire.{$applyStateBindingModifiers("\$entangle('{$statePath}')")}, masked:'', init(){ - this.masked = this.input.replaceAll('.','$decimalSeparator'); + this.masked = this.input?.replaceAll('.','$decimalSeparator'); \$watch('masked',()=>this.updateInput()); }, updateInput(){ - this.input = this.masked.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.'); + this.input = this.masked?.replaceAll('$thousandSeparator','').replaceAll('$decimalSeparator','.'); } } JS;