Skip to content

Commit

Permalink
fix: Instance outline is rendered above style panel (#4632)
Browse files Browse the repository at this point in the history
## Description

closes #4629

## 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
  • Loading branch information
istarkov authored Dec 21, 2024
1 parent a27c8b9 commit 7ec6c73
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ export const Outline = ({
Math.min(rect.left + rect.width, clampingRect.left + clampingRect.width) -
Math.max(rect.left, clampingRect.left),
};
const dynamicStyle = useDynamicStyle(outlineRect);
if (outlineRect.width <= 0 || outlineRect.height <= 0) {
return;
}

const isLeftClamped = rect.left < outlineRect.left;
const isTopClamped = rect.top < outlineRect.top;
Expand All @@ -121,8 +125,6 @@ export const Outline = ({
const isBottomClamped =
Math.round(rect.top + rect.height) > Math.round(clampingRect.height);

const dynamicStyle = useDynamicStyle(outlineRect);

return (
<>
{propertyStyle}
Expand Down

0 comments on commit 7ec6c73

Please sign in to comment.