Skip to content

Commit 0597c4f

Browse files
authored
fix: reset spacing values with alt-click (webstudio-is#5053)
## Description When alt-clicking on the label in spacing, reset the value ## Steps for reproduction 1. click button 2. expect xyz ## Code Review - [ ] hi @kof, I need you to do - conceptual review (architecture, feature-correctness) - detailed review (read every line) - test it on preview ## Before requesting a review - [ ] made a self-review - [ ] added inline comments where things may be not obvious (the "why", not "what") ## Before merging - [ ] tested locally and on preview environment (preview dev login: 0000) - [ ] updated [test cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md) document - [ ] added tests - [ ] if any new env variables are added, added them to `.env` file
1 parent 19fd987 commit 0597c4f

File tree

1 file changed

+6
-1
lines changed
  • apps/builder/app/builder/features/style-panel/sections/space

1 file changed

+6
-1
lines changed

apps/builder/app/builder/features/style-panel/sections/space/space.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { InputPopover } from "../shared/input-popover";
1212
import { StyleSection } from "../../shared/style-section";
1313
import { useKeyboardNavigation } from "../shared/keyboard";
1414
import { useComputedStyleDecl, useComputedStyles } from "../../shared/model";
15-
import { createBatchUpdate } from "../../shared/use-style-data";
15+
import { createBatchUpdate, deleteProperty } from "../../shared/use-style-data";
1616
import { useModifierKeys, type Modifiers } from "../../shared/modifier-keys";
1717

1818
const movementMapSpace = {
@@ -125,6 +125,11 @@ const Cell = ({
125125
onHover({ property, element: event.currentTarget })
126126
}
127127
onMouseLeave={() => onHover(undefined)}
128+
onClick={(event) => {
129+
if (event.altKey) {
130+
deleteProperty(property);
131+
}
132+
}}
128133
/>
129134
</>
130135
);

0 commit comments

Comments
 (0)