From ed8ab95ae7eea9bca42168700d053c7574dfef79 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Thu, 21 Jul 2022 18:37:34 +0100 Subject: [PATCH] Allow dropping on the screen component --- .../_components/navigation/ComponentListPanel.svelte | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte index 5b86d4da29..1bb4e3d9cd 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/components/[componentId]/_components/navigation/ComponentListPanel.svelte @@ -9,6 +9,7 @@ import { setContext } from "svelte" import DNDPositionIndicator from "./DNDPositionIndicator.svelte" import { DropPosition } from "./dndStore" + import { notifications } from "@budibase/bbui" let scrollRef @@ -55,6 +56,15 @@ }) } + const onDrop = async () => { + try { + await dndStore.actions.drop() + } catch (error) { + console.error(error) + notifications.error("Error saving component") + } + } + // Set scroll context so components can invoke scrolling when selected setContext("scroll", { scrollTo, @@ -83,6 +93,7 @@ opened scrollable icon="WebPage" + on:drop={onDrop} >