diff --git a/resources/views/components/ingredient-picker.blade.php b/resources/views/components/ingredient-picker.blade.php index e78a9a0..90b0f4c 100644 --- a/resources/views/components/ingredient-picker.blade.php +++ b/resources/views/components/ingredient-picker.blade.php @@ -91,6 +91,7 @@ this.$refs.ingredients_type.value = selected.dataset.type; this.$refs.ingredients_name.value = selected.dataset.name + (selected.dataset.detail ? `, ${selected.dataset.detail}` : ''); this.searching = false; + this.results = []; } } } diff --git a/resources/views/recipes/edit.blade.php b/resources/views/recipes/edit.blade.php index 42b393f..2cdd90d 100644 --- a/resources/views/recipes/edit.blade.php +++ b/resources/views/recipes/edit.blade.php @@ -72,15 +72,17 @@

Ingredients

-
- @foreach($ingredients as $ingredient) +
+ @forelse($ingredients as $ingredient) @include('recipes.partials.ingredient-input', $ingredient) - @endforeach - - - + @endforelse + + + @@ -88,22 +90,24 @@

Steps

-
- @foreach($steps as $step) +
+ @forelse($steps as $step) @include('recipes.partials.step-input', $step) - @endforeach - - + @endforelse + +
-
- +
+ {{ ($recipe->exists ? 'Save' : 'Add') }}
@@ -135,6 +139,28 @@ }, }) + @endpush @endonce diff --git a/resources/views/recipes/partials/ingredient-input.blade.php b/resources/views/recipes/partials/ingredient-input.blade.php index b3380a4..3a8201e 100644 --- a/resources/views/recipes/partials/ingredient-input.blade.php +++ b/resources/views/recipes/partials/ingredient-input.blade.php @@ -33,12 +33,11 @@
+ x-on:click="$event.target.parentNode.parentNode.parentNode.remove();">
-