Fix sidebar dropdown direction and accidental mobile drawer opening
- CSS: When sidebar is collapsed, open user-menu dropdown to the right (left: 0, right: auto) via data-sidebar-expanded="false" selector. - JS: Guard drawerToggle change handler – prevent mobile drawer from opening on desktop viewports (window.innerWidth >= 1024). - HTML: Add phx-update="ignore" to mobile-drawer checkbox to prevent LiveView from resetting its checked state on DOM patches.
This commit is contained in:
parent
97fcae3e9d
commit
c637b6b84f
3 changed files with 20 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ defmodule MvWeb.Layouts do
|
|||
data-sidebar-expanded="true"
|
||||
phx-hook="SidebarState"
|
||||
>
|
||||
<input id="mobile-drawer" type="checkbox" class="drawer-toggle" />
|
||||
<input id="mobile-drawer" type="checkbox" class="drawer-toggle" phx-update="ignore" />
|
||||
|
||||
<div class="drawer-content flex flex-col relative z-0">
|
||||
<!-- Mobile Header (only visible on mobile) -->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue