fix: improve UI elements in recipe editor
All checks were successful
CI / update (push) Successful in 1m14s

- Center isBaseRecipe toggle by changing display to inline-flex
- Fix note field editing by adding textarea with bindable value
- Clear instruction step input after submission instead of restoring placeholder
- Style note textarea with transparent background and lighter placeholder text

The instruction field now properly clears on submission, while ingredient fields retain their previous values.
This commit is contained in:
2026-01-13 19:14:25 +01:00
parent b43b45dac2
commit 296201eee5
3 changed files with 21 additions and 3 deletions

View File

@@ -247,7 +247,8 @@ export function add_new_step(){
instructions[list_index].steps.push(new_step.step) instructions[list_index].steps.push(new_step.step)
} }
const el = document.querySelector("#step") const el = document.querySelector("#step")
el.innerHTML = step_placeholder el.innerHTML = ""
new_step.step = ""
instructions = instructions //tells svelte to update dom instructions = instructions //tells svelte to update dom
} }

View File

@@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
let { note = $bindable("") } = $props<{ note?: string }>();
</script> </script>
<style> <style>
div{ div{
@@ -14,9 +15,25 @@ div{
h3{ h3{
margin-block: 0; margin-block: 0;
} }
textarea {
width: 100%;
min-height: 80px;
padding: 0.5em;
border-radius: 5px;
border: none;
color: white;
font-size: 1rem;
resize: vertical;
margin-top: 0.5em;
font-family: sans-serif;
background-color: transparent;
}
textarea::placeholder {
color: rgba(255, 255, 255, 0.6);
}
</style> </style>
<div> <div>
<h3>Notiz:</h3> <h3>Notiz:</h3>
<slot></slot> <textarea bind:value={note} placeholder="Füge eine Notiz für dieses Rezept hinzu..."></textarea>
</div> </div>

View File

@@ -4,7 +4,7 @@
<style> <style>
.toggle-wrapper { .toggle-wrapper {
display: flex; display: inline-flex;
} }
.toggle-wrapper label { .toggle-wrapper label {