From 50ecfba39535bd1728db8edcb86dea295e8c6d75 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Mon, 1 Jun 2020 11:04:32 +0100 Subject: [PATCH] few bugfixes --- .../builder/src/builderStore/store/index.js | 2 +- .../userInterface/ComponentDropdownMenu.svelte | 17 ++++++++++++----- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js index 6755bc0a7c..a034114b02 100644 --- a/packages/builder/src/builderStore/store/index.js +++ b/packages/builder/src/builderStore/store/index.js @@ -347,7 +347,7 @@ const addChildComponent = store => (componentToAdd, presetName) => { return state } - const component = getComponentDefinition(componentToAdd) + const component = getComponentDefinition(state, componentToAdd) const presetProps = presetName ? component.presets[presetName] : {} diff --git a/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte b/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte index e2f8943d9e..5672ea6f4c 100644 --- a/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte +++ b/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte @@ -11,13 +11,15 @@ export let component let confirmDeleteDialog let dropdownEl -$: dropdown = UIkit.dropdown(dropdownEl, { mode: "click", offset: 0, pos: "bottom-right" }); +$: dropdown = UIkit.dropdown(dropdownEl, { mode: "click", offset: 0, pos: "bottom-right", "delay-hide": 0, animation: false }); +$: dropdown && UIkit.util.on(dropdown, "shown", () => hidden = false) $: noChildrenAllowed = !component || getComponentDefinition($store, component._component).children === false $: noPaste = !$store.componentToPaste || $store.componentToPaste._id === component._id const lastPartOfName = c => (c ? last(c._component.split("/")) : "") -const showDropdown = () => { - dropdown.show() + +const hideDropdown = () => { + dropdown.hide() } @@ -26,7 +28,7 @@ const showDropdown = () => { -