From 5aa5ebe0ef46a92ae510403950b3e91905e2128c Mon Sep 17 00:00:00 2001 From: Dominic Date: Sun, 11 Jan 2026 18:28:40 +0100 Subject: [PATCH] fix: input-with-select Alpine timing and simplify state sync Fix component registration on SPA navigation and remove unnecessary structuredValue binding. Use modern Alpine pattern with local state and explicit commits. --- app/View/Components/Forms/InputWithSelect.php | 3 - .../forms/input-with-select.blade.php | 214 +++++++----------- 2 files changed, 78 insertions(+), 139 deletions(-) diff --git a/app/View/Components/Forms/InputWithSelect.php b/app/View/Components/Forms/InputWithSelect.php index ee25b2535..0cc03b65b 100644 --- a/app/View/Components/Forms/InputWithSelect.php +++ b/app/View/Components/Forms/InputWithSelect.php @@ -16,8 +16,6 @@ class InputWithSelect extends Component public ?string $combinedBinding = null; - public ?string $structuredBinding = null; - public function __construct( public ?string $id = null, public ?string $name = null, @@ -78,7 +76,6 @@ class InputWithSelect extends Component if ($this->modelBinding && $this->modelBinding !== 'null') { $this->combinedBinding = $this->modelBinding; - $this->structuredBinding = $this->modelBinding . 'Structured'; } if (is_null($this->defaultOption) && !empty($this->options)) { diff --git a/resources/views/components/forms/input-with-select.blade.php b/resources/views/components/forms/input-with-select.blade.php index 5a9e10d4b..51784d4c2 100644 --- a/resources/views/components/forms/input-with-select.blade.php +++ b/resources/views/components/forms/input-with-select.blade.php @@ -13,18 +13,16 @@ } -
@@ -43,19 +41,18 @@
{{-- Hidden input for wire:dirty tracking (binds to combinedValue which has the full value with unit) --}} @if ($modelBinding !== 'null') - @endif - + {{-- Input --}} - {{-- Select --}} -