Skip to content

Commit 0608c02

Browse files
committed
Fix positioning of app menus
1 parent e2aad17 commit 0608c02

3 files changed

Lines changed: 4 additions & 7 deletions

File tree

src/components/BorderedApp/BorderedApp.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"title-bar"
99
"content";
1010
border-radius: 10px 10px 0 0;
11-
backdrop-filter: blur(8px) brightness(130%);
1211
box-shadow: 0px -2px 10px 1px rgb(0, 0, 0, 0.5);
1312
position: fixed;
1413

src/components/BorderedApp/BorderedAppMenu/BorderedAppMenu.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44
align-items: center;
55
&-items {
66
width: auto;
7-
position: fixed;
7+
position: absolute;
8+
white-space: nowrap;
89
box-sizing: border-box;
910
box-shadow: 0 0 2px rgb(0, 0, 0, 0.5);
10-
// Cant use backdrop-filter on fixed elements :(
11-
// backdrop-filter: blur(8px) brightness(130%);
12-
// background-color: darkmagenta;
1311

1412
&__content {
1513
box-sizing: border-box;

src/components/BorderedApp/BorderedAppMenu/BorderedAppMenu.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ function BorderedAppMenuItem({
3434
// still it's initial value. This avoids incorrectly adding
3535
// multiple times when the effect fires multiple times.
3636
if (elementPosition.current.x === position.x) {
37-
elementPosition.current.x += rect?.width ?? 0;
37+
elementPosition.current.x = rect?.width ?? 0;
3838
}
3939
if (elementPosition.current.y === position.y) {
40-
elementPosition.current.y += (rect?.height ?? 0) * (itemNo - 1);
40+
elementPosition.current.y = (rect?.height ?? 0) * (itemNo - 1);
4141
}
4242
}, [elementRef, itemNo, position]);
4343
const [open, setOpen] = useState<boolean>(false);

0 commit comments

Comments
 (0)