-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
When expanding or collapsing the sidebar in desktop view the state
from useSidebar
hook changes from collapsed
to expanded
as expected.
When expanding or collapsing the sidebar in mobile view the state
stays unchanged as collapsed
Affected component/components
Sidebar
How to reproduce
- use the shadcn sidebar in any project (as per tutorial here)
- log the state in the console
- toggle the state in desktop view
- toggle the state in mobile view (e.g. via chrome dev tools)
const { state, isMobile } = useSidebar();
console.log("current state", state, "isMobile", isMobile);
Codesandbox/StackBlitz link
n/a
Logs
mobile:
AppSidebar.tsx:110 current state collapsed isMobile true
AppSidebar.tsx:110 current state collapsed isMobile true
desktop:
AppSidebar.tsx:110 current state expanded isMobile false
AppSidebar.tsx:110 current state collapsed isMobile false
System Info
Windows 11, MS Edge
Before submitting
- I've made research efforts and searched the documentation
- I've searched for existing issues
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working