diff --git a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue
index 36ba0a0e6..9e2d80211 100644
--- a/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue
+++ b/frontend/components/Domain/Recipe/RecipePage/RecipePageParts/RecipePageInstructions.vue
@@ -170,27 +170,25 @@
-
-
-
-
+ handleImageDrop(index, f)">
+
+
+
+
+
@@ -233,6 +231,7 @@ import { uuid4, detectServerBaseUrl } from "~/composables/use-utils";
import { useUserApi, useStaticRoutes } from "~/composables/api";
import { usePageState } from "~/composables/recipe-page/shared-state";
import { NoUndefinedField } from "~/types/api";
+import DropZone from "~/components/global/DropZone.vue";
interface MergerHistory {
target: number;
@@ -245,6 +244,7 @@ export default defineComponent({
components: {
draggable,
RecipeIngredientHtml,
+ DropZone,
},
props: {
value: {
@@ -582,13 +582,13 @@ export default defineComponent({
}
});
- async function handleImageDrop(index: number, e: DragEvent) {
- if (!e.dataTransfer) {
+ async function handleImageDrop(index: number, files: File[]) {
+ if (!files) {
return;
}
// Check if the file is an image
- const file = e.dataTransfer.files[0];
+ const file = files[0];
if (!file || !file.type.startsWith("image/")) {
return;
}
diff --git a/frontend/components/global/DropZone.vue b/frontend/components/global/DropZone.vue
new file mode 100644
index 000000000..c00ae434a
--- /dev/null
+++ b/frontend/components/global/DropZone.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+