Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Clicking the current breakpoint should not deselect the breakpoint. (#1777)

Wasim Thoufiq4d270452ed31
diff --git a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
index be6d465f09..f3fd5e3c9c 100644
--- a/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
+++ b/apps/builder/app/builder/features/breakpoints/breakpoints-selector.tsx
@@ -65,6 +65,11 @@ export const BreakpointsSelector = ({
type="single"
value={selectedBreakpoint.id}
onValueChange={(breakpointId: string) => {
+ // onValueChange gives empty string when unselected
+ // which is not part of breakpoints so do nothing in this case
+ if (breakpoints.has(breakpointId) === false) {
+ return;
+ }
selectedBreakpointIdStore.set(breakpointId);
setInitialCanvasWidth(breakpointId);
}}