Skip to content

Commit 0bf2857

Browse files
authored
Input: handle .blur for money (#913)
* Exclude 'wire:model.blur' from attributes when money is enabled in Input Component * Add blur event handling for currency input
1 parent eadd396 commit 0bf2857

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/View/Components/Input.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,14 @@ class="w-full"
146146
x-ref="myInput"
147147
:value="amount"
148148
x-on:input="$nextTick(() => $wire.set('{{ $modelName() }}', Currency.getUnmasked(), {{ json_encode($attributes->wire('model')->hasModifier('live')) }}))"
149+
x-on:blur="$nextTick(() => $wire.set('{{ $modelName() }}', Currency.getUnmasked(), {{ json_encode($attributes->wire('model')->hasModifier('blur')) }}))"
149150
inputmode="numeric"
150151
@endif
151152
152153
{{
153154
$attributes
154155
->merge(['type' => 'text'])
155-
->except($money ? ['wire:model', 'wire:model.live'] : '')
156+
->except($money ? ['wire:model', 'wire:model.live', 'wire:model.blur'] : '')
156157
}}
157158
/>
158159

0 commit comments

Comments
 (0)