Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Take the flyout into account when positioning the workspace after a toolbox change. #8617

Merged
merged 2 commits into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions core/toolbox/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -734,13 +734,18 @@ export class Toolbox
// relative to the new absolute edge (ie toolbox edge).
const workspace = this.workspace_;
const rect = this.HtmlDiv!.getBoundingClientRect();
const flyout = this.getFlyout();
const newX =
this.toolboxPosition === toolbox.Position.LEFT
? workspace.scrollX + rect.width
? workspace.scrollX +
rect.width +
(flyout?.isVisible() ? flyout.getWidth() : 0)
: workspace.scrollX;
const newY =
this.toolboxPosition === toolbox.Position.TOP
? workspace.scrollY + rect.height
? workspace.scrollY +
rect.height +
(flyout?.isVisible() ? flyout.getHeight() : 0)
: workspace.scrollY;
workspace.translate(newX, newY);

Expand Down
Loading