Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions frontend/src/components/StudioCanvas.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
class="w-auto cursor-pointer p-2"
v-for="breakpoint in canvasProps.breakpoints"
:key="breakpoint.device"
@click.stop="breakpoint.visible = !breakpoint.visible"
@click.stop="selectBreakpoint(breakpoint)"
>
<FeatherIcon
:name="breakpoint.icon"
Expand Down Expand Up @@ -175,7 +175,7 @@ const canvasProps = reactive({
provide("canvasProps", canvasProps)

const visibleBreakpoints = computed(() => {
return canvasProps.breakpoints.filter((breakpoint) => breakpoint.visible || breakpoint.device === "desktop")
return canvasProps.breakpoints.filter((breakpoint) => breakpoint.visible)
})
watch(
() => canvasProps.breakpoints.map((b) => b.visible),
Expand All @@ -186,6 +186,12 @@ watch(
setScaleAndTranslate()
},
)
function selectBreakpoint(breakpoint: BreakpointConfig) {
breakpoint.visible = !breakpoint.visible
if (canvasProps.breakpoints.filter((bp) => bp.visible).length === 0) {
breakpoint.visible = true
}
}

// clone props.block into canvas data to avoid mutating them
const rootComponent = ref(getBlockCopy(props.componentTree, true))
Expand Down
Loading