Dropdowns open as sheets on phones, come into view, and take no room closed
A closed dropdown's content stayed displayed whenever it carried a display class (flex, grid), only invisible, so it still took room: the React picker past a card's right edge made the whole feed scroll sideways on a phone (294px at 360px). A closed one is now not displayed at all. DDropdown moves the focus into its content on opening, which also scrolls a menu cut off by the feed into view, and gives it back to its trigger after Escape or an outside tap. New SheetOnNarrow makes the content a sheet from the bottom of the screen below md, over a dimmed page, at most 80dvh tall. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LsXgEaXee4GCU1hwYgPJXw
This commit is contained in:
1 parent
f1cb90ac03
commit
63f2517f5b
2 files changed
+49
-16
No files matched your search
+4
-3
@@ -278,10 +278,11 @@
|
||||
background-color: var(--color-base-100);
|
||||
box-shadow: -3px -3px 6px var(--neo-light), 3px 3px 6px var(--neo-dark);
|
||||
|
||||
/* A display utility on the content (flex, grid) beats daisyUI's display:none on a closed dropdown, which then stays
|
||||
invisible (opacity 0) but still in the way of the pointer, over whatever it covers: hide it from the pointer too. */
|
||||
/* A display utility on the content (flex, grid) beats daisyUI's display:none on a closed dropdown, which then stayed
|
||||
invisible (opacity 0) but in the way of the pointer, and still took room: a closed menu past a card's edge made
|
||||
the feed scroll sideways on a phone. A closed one is not displayed at all. */
|
||||
:where(.dropdown.dropdown-close, .dropdown:not(.dropdown-open, .dropdown-hover:hover, :focus-within)) & {
|
||||
visibility: hidden;
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user