Skip to content

feat(Layout): add click-to-expand mode for collapsed sidebar #8348

Description

@h2ls

Is there an existing issue for this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe the problem.

When the Layout sidebar is collapsed (IsCollapsed="true"), it automatically expands whenever the mouse hovers over it. In some scenarios this hover-expand behavior is too sensitive — simply moving the mouse across the sidebar area expands it and shifts the layout, which is distracting.

Describe the solution you'd like

Add a new IsExpandOnHover parameter (default true, keeping the current behavior). When set to false:

  • Hovering over the collapsed sidebar does not expand it
  • Clicking the collapsed sidebar expands it
  • Moving the mouse out of the sidebar area collapses it back
<Layout IsCollapsed="true" IsExpandOnHover="false" ...>

Additional context

Implementation ready: the hover-expand rule in Layout.razor.scss is gated behind :not(.is-click-expand), and a click-expand mode toggles an is-expand class via @onclick / @onmouseleave on the sidebar. Unit test IsExpandOnHover_OK added.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions