From 1fcf860e2189d4e5c2b4f4d5e922e1073c6d78a9 Mon Sep 17 00:00:00 2001 From: AtmoFX Date: Sat, 31 May 2025 13:59:43 +0800 Subject: [PATCH] Fixed styling for input (regular and money) --- src/View/Components/Input.php | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/View/Components/Input.php b/src/View/Components/Input.php index 0d4342c8..b268dab6 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'] : '') }} /> {{-- HIDDEN MONEY INPUT + END MONEY SETUP --}} @if($money) - wire('model') }} /> -
+ wire('model') }} /> @endif {{-- CLEAR ICON --}}