From e0a376dd7b980a9d95de5e3ce048cdd48343fed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Keviin=20=C3=85berg=20Kultalahti?= Date: Tue, 27 Apr 2021 17:04:50 +0200 Subject: [PATCH] cleanup component selection list --- .../AppPreview/ComponentSelectionList.svelte | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte index 97677b3ca5..0fd334794a 100644 --- a/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte +++ b/packages/builder/src/components/design/AppPreview/ComponentSelectionList.svelte @@ -32,11 +32,8 @@ return enrichedStructure } - const onItemChosen = async (item, idx) => { - if (item.isCategory) { - // Select and open this category - selectedIndex = idx - } else { + const onItemChosen = async (item) => { + if (!item.isCategory) { // Add this component await store.actions.components.create(item.component) } @@ -44,15 +41,14 @@ - {#each enrichedStructure as item, idx} + {#each enrichedStructure as item} onItemChosen(item, idx)} + slot="control" + on:click={() => onItemChosen(item)} > {item.name}