fix: improve UI elements in recipe editor

- 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 bf7210dc2e
commit 293cab7fa2
3 changed files with 21 additions and 3 deletions
+2 -1
View File
@@ -247,7 +247,8 @@ export function add_new_step(){
instructions[list_index].steps.push(new_step.step)
}
const el = document.querySelector("#step")
el.innerHTML = step_placeholder
el.innerHTML = ""
new_step.step = ""
instructions = instructions //tells svelte to update dom
}
+18 -1
View File
@@ -1,4 +1,5 @@
<script lang="ts">
let { note = $bindable("") } = $props<{ note?: string }>();
</script>
<style>
div{
@@ -14,9 +15,25 @@ div{
h3{
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>
<div>
<h3>Notiz:</h3>
<slot></slot>
<textarea bind:value={note} placeholder="Füge eine Notiz für dieses Rezept hinzu..."></textarea>
</div>
+1 -1
View File
@@ -4,7 +4,7 @@
<style>
.toggle-wrapper {
display: flex;
display: inline-flex;
}
.toggle-wrapper label {