From 8cb47af21b812302fa76dcd355ea7ccc08a7f739 Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Mon, 4 Dec 2023 16:34:30 +0000 Subject: [PATCH 1/2] fix: mutator coordinates not respecting flyout --- core/flyout_horizontal.ts | 16 ++++++++++++++++ core/flyout_vertical.ts | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/core/flyout_horizontal.ts b/core/flyout_horizontal.ts index 02ac7377ad4..0514c27cf06 100644 --- a/core/flyout_horizontal.ts +++ b/core/flyout_horizontal.ts @@ -382,6 +382,22 @@ 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!.toolboxPosition === this.toolboxPosition_ && + this.toolboxPosition_ === toolbox.Position.TOP && + !this.targetWorkspace!.getToolbox() && + !this.autoClose && + !this.targetWorkspace.scrollbar + ) { + this.targetWorkspace!.translate( + this.targetWorkspace!.scrollX, + this.targetWorkspace!.scrollY + flyoutHeight, + ); + } + this.height_ = flyoutHeight; this.position(); this.targetWorkspace.resizeContents(); diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index 72c53efbf3a..df0b4c7f4a1 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -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!.toolboxPosition === this.toolboxPosition_ && + this.toolboxPosition_ === toolbox.Position.LEFT + ) { + this.targetWorkspace!.translate( + this.targetWorkspace!.scrollX + flyoutWidth, + this.targetWorkspace!.scrollY, + ); + } + this.width_ = flyoutWidth; this.position(); this.targetWorkspace.resizeContents(); From 2ef5fcd3f9deff593fab00271f538e095091a5bf Mon Sep 17 00:00:00 2001 From: Beka Westberg Date: Tue, 5 Dec 2023 18:46:08 +0000 Subject: [PATCH 2/2] chore: fixup conditionals --- core/flyout_horizontal.ts | 13 ++++++------- core/flyout_vertical.ts | 8 ++++---- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/core/flyout_horizontal.ts b/core/flyout_horizontal.ts index 0514c27cf06..9c9490b227f 100644 --- a/core/flyout_horizontal.ts +++ b/core/flyout_horizontal.ts @@ -386,15 +386,14 @@ export class HorizontalFlyout extends Flyout { // Workspace with no scrollbars where this is permanently open on the top. // If scrollbars exist they properly update the metrics. if ( - this.targetWorkspace!.toolboxPosition === this.toolboxPosition_ && - this.toolboxPosition_ === toolbox.Position.TOP && - !this.targetWorkspace!.getToolbox() && + !this.targetWorkspace.scrollbar && !this.autoClose && - !this.targetWorkspace.scrollbar + this.targetWorkspace.getFlyout() === this && + this.toolboxPosition_ === toolbox.Position.TOP ) { - this.targetWorkspace!.translate( - this.targetWorkspace!.scrollX, - this.targetWorkspace!.scrollY + flyoutHeight, + this.targetWorkspace.translate( + this.targetWorkspace.scrollX, + this.targetWorkspace.scrollY + flyoutHeight, ); } diff --git a/core/flyout_vertical.ts b/core/flyout_vertical.ts index df0b4c7f4a1..c9ce4f6593d 100644 --- a/core/flyout_vertical.ts +++ b/core/flyout_vertical.ts @@ -382,12 +382,12 @@ export class VerticalFlyout extends Flyout { if ( !this.targetWorkspace.scrollbar && !this.autoClose && - this.targetWorkspace!.toolboxPosition === this.toolboxPosition_ && + this.targetWorkspace.getFlyout() === this && this.toolboxPosition_ === toolbox.Position.LEFT ) { - this.targetWorkspace!.translate( - this.targetWorkspace!.scrollX + flyoutWidth, - this.targetWorkspace!.scrollY, + this.targetWorkspace.translate( + this.targetWorkspace.scrollX + flyoutWidth, + this.targetWorkspace.scrollY, ); }