From 91738c4e417d11643578018912d6dac3be98743e Mon Sep 17 00:00:00 2001 From: Elain T Date: Fri, 7 Jun 2024 12:21:00 -0600 Subject: [PATCH] feat(design-land): update they way open is set for the design land sidebar (#2837) --- .../sidebar-viewport/sidebar-viewport.component.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport.component.ts b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport.component.ts index fbf4ead7fd..0656484026 100644 --- a/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport.component.ts +++ b/apps/design-land/src/app/core/sidebar-viewport/sidebar-viewport.component.ts @@ -30,9 +30,16 @@ export class DesignLandSidebarViewportComponent { public open = false; constructor(private breakpoint: BreakpointObserver) { - this.open = this.breakpoint.isMatched(DaffBreakpoints.BIG_TABLET); this.mode$ = this.breakpoint.observe(DaffBreakpoints.BIG_TABLET).pipe( - map((match) => match.matches ? DaffSidebarModeEnum.SideFixed : DaffSidebarModeEnum.Under), + map((match) => { + if (match.matches) { + this.open = true; + return DaffSidebarModeEnum.SideFixed; + } else { + this.open = false; + return DaffSidebarModeEnum.Over; + } + }), ); }