fix: mutator coordinates not respecting flyout (#7690)

* fix: mutator coordinates not respecting flyout

* chore: fixup conditionals
This commit is contained in:
Beka Westberg
2023-12-05 18:51:21 +00:00
committed by GitHub
parent 0836a1db10
commit 45cc1e8fea
2 changed files with 31 additions and 0 deletions

View File

@@ -382,6 +382,21 @@ export class HorizontalFlyout extends Flyout {
}
}
// TODO(#7689): Remove this.
// Workspace with no scrollbars where this is permanently open on the top.
// If scrollbars exist they properly update the metrics.
if (
!this.targetWorkspace.scrollbar &&
!this.autoClose &&
this.targetWorkspace.getFlyout() === this &&
this.toolboxPosition_ === toolbox.Position.TOP
) {
this.targetWorkspace.translate(
this.targetWorkspace.scrollX,
this.targetWorkspace.scrollY + flyoutHeight,
);
}
this.height_ = flyoutHeight;
this.position();
this.targetWorkspace.resizeContents();

View File

@@ -375,6 +375,22 @@ export class VerticalFlyout extends Flyout {
}
}
// TODO(#7689): Remove this.
// Workspace with no scrollbars where this is permanently
// open on the left.
// If scrollbars exist they properly update the metrics.
if (
!this.targetWorkspace.scrollbar &&
!this.autoClose &&
this.targetWorkspace.getFlyout() === this &&
this.toolboxPosition_ === toolbox.Position.LEFT
) {
this.targetWorkspace.translate(
this.targetWorkspace.scrollX + flyoutWidth,
this.targetWorkspace.scrollY,
);
}
this.width_ = flyoutWidth;
this.position();
this.targetWorkspace.resizeContents();