diff --git a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
index 026150f957..c2ead2eef9 100644
--- a/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
+++ b/packages/builder/src/components/design/PropertiesPanel/PropertyControls/PropertyControl.svelte
@@ -4,6 +4,8 @@
readableToRuntimeBinding,
runtimeToReadableBinding,
} from "builderStore/dataBinding"
+ import { setContext } from "svelte"
+ import { store } from "builderStore"
export let label = ""
export let componentInstance = {}
@@ -61,6 +63,28 @@
? defaultValue
: enriched
}
+
+ setContext("builderFocus", {
+ clear: () => {
+ if (!$store?.builderFocus) {
+ return
+ }
+ store.update(state => {
+ const updatedFocus = $store?.builderFocus?.filter(focus => {
+ return (
+ focus.location === "component_settings" &&
+ focus.target !== componentInstance._id
+ )
+ })
+ if (updatedFocus?.length > 0) {
+ state.builderFocus = updatedFocus
+ } else {
+ delete state.builderFocus
+ }
+ return state
+ })
+ },
+ })
diff --git a/packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte
index 5aa66305f4..44240c61f1 100644
--- a/packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte
+++ b/packages/builder/src/pages/builder/app/[application]/design/[assetType]/_layout.svelte
@@ -20,7 +20,6 @@
import DevicePreviewSelect from "components/design/AppPreview/DevicePreviewSelect.svelte"
import Logo from "assets/bb-space-man.svg"
import ScreenWizard from "components/design/NavigationPanel/ScreenWizard.svelte"
- import { clickOutside } from "@budibase/bbui"
// Cache previous values so we don't update the URL more than necessary
let previousType
@@ -197,27 +196,7 @@
{#if $selectedComponent != null}
-
{
- if ($store?.builderFocus) {
- const otherSettings = $store?.builderFocus?.filter(field => {
- return field.location !== "component_settings"
- })
- if (otherSettings.length) {
- store.update(state => {
- state.builderFocus = otherSettings
- return state
- })
- } else {
- store.update(state => {
- delete state.builderFocus
- return state
- })
- }
- }
- }}
- >
+
{/if}
diff --git a/packages/client/src/components/app/Placeholder.svelte b/packages/client/src/components/app/Placeholder.svelte
index a9c5b7f328..4fb182ff12 100644
--- a/packages/client/src/components/app/Placeholder.svelte
+++ b/packages/client/src/components/app/Placeholder.svelte
@@ -19,7 +19,6 @@
return componentKey
}
- //Corify this somewhere
const emptyFields = (definition, options) => {
if (!options) {
return []
@@ -62,9 +61,6 @@
{:else}
{text || $component.name || "Placeholder"}
-
{/if}