Make sidebar closed by default on mobile.
When you login inside Admin panel on mobile for first time, you get the sidebar opened by default. How can i disable that? Ofcourse it would be opened again if i closed and never left opened. But i want to keep it closed for when a user logs in for first time.
Thanks.
7 Replies
sounds like a bug, you should try and fix it in a PR :)
I would be happy to do that.
I am on it. It would be my second PR π
I am not sure where to look or get started..
This should be false by default i guess?
that would break the collapsible sidebar on deskop
as that uses the same isOpen
and should probably be open by default?
i dont know if there is a good way to fix this
ah you are right. it would break it.
May be we could store isOpen to null by default and if its not persisted yet. we do a check based on screen width?
x-init="sidebar.isOpen = window.innerWidth >= 768"
hard to think about the fix that would not break the existing...that would be a problem if someone customised the tailwind breakpoints
hmm. I might have to move with this workaround.. If find a solution if will write here or send a pr.
thanks Dan π
I came up with following work around. In case if anyone needs it.