nuxt / nuxt/ui

`DashboardSidebarCollapse` controls the `DashboardSidebar` despite its `collapsed` value being readonly

Open
#4,789 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

v5
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Environment
  • Node Version: v20.12.1
  • Nuxt Version: 4.0.3
  • CLI Version: 3.28.0
  • Nitro Version: 2.12.4
  • Package Manager: pnpm@8.15.6
  • Builder: -
  • User Config: devtools, modules, css, compatibilityDate
  • Runtime Modules: @nuxt/ui@4.5.0, @nuxt/eslint@1.9.0, @vueuse/nuxt@13.7.0
  • Build Modules: -
Version

v4.5.0

Reproduction

https://codesandbox.io/p/sandbox/pxxcvj

Description

Attaching a read-only :collapsed to DashboardSidebar does not prevent DashboardSidebarCollapse from collapsing/expanding the sidebar.

In the reproduction, when you change the width of the screen to be narrower than 96rem, sidebar will always collapse. When you widen it back out, sidebar will expand if it was expanded before.

If you make the screen narrower until the sidebar collapses, and then press the DashboardSidebarCollapse, it will expand, despite the fact that the computed collapsed is still true.

In the reproduction that is represented by having collapsed: true written on the page, but the sidebar being expanded.

Expected the sidebar to keep being collapsed, until computed collapsed becomes false.

Additional context

No response

Logs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DashboardSidebar and DashboardSidebarCollapse components, then reproduce the behavior using the linked CodeSandbox while changing the viewport below and above 96rem. Trace how the readonly collapsed value and the collapse control interact; done means the sidebar cannot expand or collapse against that value, with the existing responsive behavior preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.