From dbc207b06042be229e351fb6c12bb52f88a863d6 Mon Sep 17 00:00:00 2001 From: AriaieBOY Date: Tue, 14 May 2024 12:58:51 +0330 Subject: [PATCH] refactor the currency mask to use native alpine x-model --- resources/views/currency-mask.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/resources/views/currency-mask.blade.php b/resources/views/currency-mask.blade.php index 2e3bbc8..cf99079 100644 --- a/resources/views/currency-mask.blade.php +++ b/resources/views/currency-mask.blade.php @@ -18,11 +18,11 @@ $xdata = <<this.updateInput()); \$watch('input',()=>this.updateMasked()); - \$el.addEventListener('input',(event)=>this.updateInput()); - \$el.addEventListener('blur',(event)=>this.updateInput()); }, updateMasked(){ if(typeof Number(this.input) === 'number'){ @@ -79,7 +79,7 @@ class="fi-fo-text-input" 'step' => $getStep(), 'type' => 'text', 'x-data' => $xdata, - 'x-on:change'=>'updateInput', + 'x-model'=>'masked', 'x-mask:dynamic' => $xmask ], escape: false) "