From a72cffeac8c6e66f38ddc8572af307697cdee5ad Mon Sep 17 00:00:00 2001 From: Jibran Absarulislam Date: Fri, 23 Jun 2023 01:45:44 -0400 Subject: [PATCH 1/2] fix: set flyout visbility on calling setExpanded --- core/toolbox/collapsible_category.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index cb5270995ef..4449fef0538 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -185,7 +185,7 @@ export class CollapsibleToolboxCategory } /** - * Opens or closes the current category. + * Opens or closes the current category and the associated flyout. * * @param isExpanded True to expand the category, false to close. */ @@ -200,6 +200,7 @@ export class CollapsibleToolboxCategory this.subcategoriesDiv_!.style.display = 'none'; this.closeIcon_(this.iconDom_); } + this.parentToolbox_.getFlyout()?.setVisible(isExpanded); aria.setState( this.htmlDiv_ as HTMLDivElement, aria.State.EXPANDED, From 6592a13e1131a6df9f00a5d9adfa1edaf5cbd0da Mon Sep 17 00:00:00 2001 From: Jibran Absarulislam Date: Fri, 23 Jun 2023 14:08:08 -0400 Subject: [PATCH 2/2] move setVisible to only set false when category is no longer expanded --- core/toolbox/collapsible_category.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/toolbox/collapsible_category.ts b/core/toolbox/collapsible_category.ts index 4449fef0538..fe4b7cf5584 100644 --- a/core/toolbox/collapsible_category.ts +++ b/core/toolbox/collapsible_category.ts @@ -197,10 +197,10 @@ export class CollapsibleToolboxCategory this.subcategoriesDiv_!.style.display = 'block'; this.openIcon_(this.iconDom_); } else { + this.parentToolbox_.getFlyout()?.setVisible(false); this.subcategoriesDiv_!.style.display = 'none'; this.closeIcon_(this.iconDom_); } - this.parentToolbox_.getFlyout()?.setVisible(isExpanded); aria.setState( this.htmlDiv_ as HTMLDivElement, aria.State.EXPANDED,