diff --git a/src/View/Components/Input.php b/src/View/Components/Input.php index cc89a808..efc14c0b 100644 --- a/src/View/Components/Input.php +++ b/src/View/Components/Input.php @@ -114,6 +114,9 @@ public function render(): View|Closure|string "!input-error" => $errorFieldName() && $errors->has($errorFieldName()) && !$omitError ]) }} + @if($money) + x-data="{ amount: $wire.get('{{ $modelName() }}') }" x-init="$nextTick(() => new Currency($refs.myInput, {{ $moneySettings() }}))" + @endif > {{-- PREFIX --}} @if($prefix) @@ -125,14 +128,6 @@ public function render(): View|Closure|string @endif - {{-- MONEY SETUP --}} - @if($money) -
- @endif - {{-- INPUT --}} merge(['type' => 'text']) + ->except('class') ->except($money ? ['wire:model', 'wire:model.live', 'wire:model.blur'] : '') }} /> {{-- HIDDEN MONEY INPUT + END MONEY SETUP --}} @if($money) - wire('model') }} /> -
+ wire('model') }} /> @endif {{-- CLEAR ICON --}}