Prechádzať zdrojové kódy

Address Svelte warnings

Lee Morgan 1 mesiac pred
rodič
commit
3adc6e2bbd

+ 2 - 2
src/routes/+page.svelte

@@ -9,8 +9,8 @@
 <form>
     <input type="text" placeholder="Search Recipes" bind:this={searchInput} required>
 
-    <button>
-        <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000">
+    <button type="submit" aria-label="Search recipes">
+        <svg width="24px" height="24px" viewBox="0 0 24 24" fill="none" color="#000000" aria-hidden="true">
             <path d="M17 17L21 21" stroke="#ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
             <path d="M3 11C3 15.4183 6.58172 19 11 19C13.213 19 15.2161 18.1015 16.6644 16.6493C18.1077 15.2022 19 13.2053 19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11Z" stroke="#ffffff" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
         </svg>

+ 3 - 2
src/routes/recipe/EditableRecipe.svelte

@@ -1,4 +1,5 @@
 <script>
+    import {untrack} from "svelte";
     import {notify} from "$lib/notifier.svelte.js";
     import {goto} from "$app/navigation";
 
@@ -12,8 +13,8 @@
         visibility,
         route
     } = $props();
-    let ingredients = $state(ingredientsProp);
-    let steps = $state(stepsProp);
+    let ingredients = $state(untrack(()=>$state.snapshot(ingredientsProp)));
+    let steps = $state(untrack(()=>$state.snapshot(stepsProp)));
     let quantity = $state();
     let unit = $state("");
     let ingredientName = $state("");