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

[DashboardLayout] Fix sidebar CSS transitions for some breakpoints #4522

Merged
merged 8 commits into from
Jan 7, 2025
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@ function DashboardLayout(props: DashboardLayoutProps) {
[toggleNavigationExpanded],
);

const hasDrawerTransitions =
isOverSmViewport && (disableCollapsibleSidebar || !isUnderMdViewport);
const hasDrawerTransitions = isOverSmViewport && !disableCollapsibleSidebar;
Copy link
Member

@apedroferreira apedroferreira Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const hasDrawerTransitions = isOverSmViewport && !disableCollapsibleSidebar;
const hasDrawerTransitions = isOverSmViewport && (!disableCollapsibleSidebar || isOverMdViewport);

Thanks a lot for your PR!

Looks like this suggestion would be the correct logic instead, as when disableCollapsibleSidebar is true, the non-persistent drawer menu shows up to the md breakpoint as opposed to just sm.

This would require replacing the isUnderMdViewport variable with isOverMdViewport and inverting all logic where isUnderMdViewport is currently being used (it's only in a couple of places).

Copy link
Member

@apedroferreira apedroferreira Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first suggestion was incorrect, the new one should be good!
Sorry if it caused any confusion.


const ToolbarActionsSlot = slots?.toolbarActions ?? ToolbarActions;
const ToolbarAccountSlot = slots?.toolbarAccount ?? Account;
Expand Down
Loading