Skip to content

Commit

Permalink
fix broken resize handling
Browse files Browse the repository at this point in the history
  • Loading branch information
martrapp committed Jul 31, 2024
1 parent 8350d5e commit 74279be
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cold-snakes-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vtbag/inspection-chamber': patch
---

Fixes broken resize behavior of enlarged panel.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
### Patch Changes

- 8a89a9e: Tries to improve opening the chamber on mobile.
- 8529e93: Adds an explicit button to close the inner window (in addition to the existing option to click the header again).
- 8529e93: Adds an explicit button to close the enlarged panel (in addition to the existing option to click the heading again).
- b575757: Fixes some styling issues

## 1.0.3 - 2024-07-28
Expand Down
2 changes: 1 addition & 1 deletion src/panel/inner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export function initInnerPanel() {
innerPanel.style.top = `${y}px`;
});

initDragging(innerPanel.children[INNER_POSITION] as HTMLElement, (x: number, y: number) => {
initDragging(innerPanel.children[innerPanel.children.length-1] as HTMLElement, (x: number, y: number) => {
const rect = innerPanel.getBoundingClientRect();
innerPanel.style.width = `${Math.max(200, x - rect.x + 32)}px`;
innerPanel.style.height = `${Math.max(200, y - rect.y + 32)}px`;
Expand Down

0 comments on commit 74279be

Please sign in to comment.