Skip to content

Commit 06e1624

Browse files
committed
Fix: issue in visibility offset
1 parent 1f37e86 commit 06e1624

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
Changelog
22

3+
# v3.2.2 [2024-12-25]
4+
5+
## Patch Release
6+
7+
### Fixes
8+
- Fixed an issue when there is no visibility offset
9+
310
# v3.2.1 [2024-12-18]
411

512
## Patch Release

src/components/workspace/dock/index.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ import { VisibilityFreezeScale, VisibilityOffset } from "./visibility";
1515

1616
const handleElementVisibility = debounce((workspace, k) => {
1717
const visibilityOffset = +workspace.attr(dataAttributes.visibilityOffset) || 0;
18-
const initialViewBoxScaleForWidth = +workspace.attr(dataAttributes.initialViewBoxScaleForWidth);
19-
if (k * 1.1 < getScaleFactorAccountingForViewBoxWidth(visibilityOffset, initialViewBoxScaleForWidth)) {
20-
showPreOffsetElements();
21-
} else {
22-
showPostOffsetElements();
18+
if (visibilityOffset) {
19+
const initialViewBoxScaleForWidth = +workspace.attr(dataAttributes.initialViewBoxScaleForWidth);
20+
if (k * 1.1 < getScaleFactorAccountingForViewBoxWidth(visibilityOffset, initialViewBoxScaleForWidth)) {
21+
showPreOffsetElements();
22+
} else {
23+
showPostOffsetElements();
24+
}
2325
}
2426
}, 25);
2527

0 commit comments

Comments
 (0)