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.

fix: reset spacing values with alt-click (#5053)

Oleg Isonen0597c4f5fcfe
diff --git a/apps/builder/app/builder/features/style-panel/sections/space/space.tsx b/apps/builder/app/builder/features/style-panel/sections/space/space.tsx
index d336a8f206..7be58e0850 100644
--- a/apps/builder/app/builder/features/style-panel/sections/space/space.tsx
+++ b/apps/builder/app/builder/features/style-panel/sections/space/space.tsx
@@ -12,7 +12,7 @@ import { InputPopover } from "../shared/input-popover";
import { StyleSection } from "../../shared/style-section";
import { useKeyboardNavigation } from "../shared/keyboard";
import { useComputedStyleDecl, useComputedStyles } from "../../shared/model";
-import { createBatchUpdate } from "../../shared/use-style-data";
+import { createBatchUpdate, deleteProperty } from "../../shared/use-style-data";
import { useModifierKeys, type Modifiers } from "../../shared/modifier-keys";
const movementMapSpace = {
@@ -125,6 +125,11 @@ const Cell = ({
onHover({ property, element: event.currentTarget })
}
onMouseLeave={() => onHover(undefined)}
+ onClick={(event) => {
+ if (event.altKey) {
+ deleteProperty(property);
+ }
+ }}
/>
</>
);