Allow view deselect when clicking on empty area. Screen is no longer highlighted

This commit is contained in:
Dean 2024-03-19 14:11:55 +00:00
parent a5da7946db
commit 308897d972
4 changed files with 7 additions and 6 deletions

View File

@ -37,6 +37,7 @@
"svg",
"bmp",
"jfif",
"webp",
]
const fieldId = id || uuid()

View File

@ -130,7 +130,7 @@
// Catch any app errors
loading = false
error = event.error || "An unknown error occurred"
} else if (type === "select-component" && data.id) {
} else if (type === "select-component" && "id" in data) {
componentStore.select(data.id)
} else if (type === "hover-component") {
hoverStore.hover(data.id, false)

View File

@ -284,10 +284,6 @@
<div
class="main-wrapper"
on:click={() => {
// inBuilder
// check selected
// selectedComponentId : "ce300d7f6c08b432b8db18d11690932f5"
console.log("Screen check ", $builderStore)
if ($builderStore.inBuilder) {
builderStore.actions.selectComponent(null)
}

View File

@ -5,10 +5,14 @@
$: color = $builderStore.editMode
? "var(--spectrum-global-color-static-green-500)"
: "var(--spectrum-global-color-static-blue-600)"
$: isScreen = $builderStore.selectedComponentId?.startsWith(
$builderStore.screen._id
)
</script>
<IndicatorSet
componentId={$builderStore.selectedComponentId}
componentId={!isScreen ? $builderStore.selectedComponentId : null}
{color}
zIndex="910"
transition