Two independent axes: mobile_presentation (device → floating vs fullscreen overlay) and collapse_badges_below (the element's own box → badge display).
🌐 client — runs in the browser (element JS API) 🖥️ server — LiveView round-trip
mobile_presentation="fullscreen"
on the demo so the overlay is inspectable on desktop; unchecking restores
mobile_presentation="auto" (floating here).
mobile_presentation="auto | floating | fullscreen"
auto keeps the floating panel on desktop/tablet and switches to a full-screen
overlay on phone-sized touch devices; floating forces the anchored panel
everywhere; fullscreen forces the overlay on any device.
<.web_multiselect mobile_presentation="fullscreen" />
fullscreen_autofocus={true}
By default the fullscreen sheet opens with the list visible and the keyboard closed — it
appears only when you tap the search field. Set fullscreen_autofocus={true}
to focus the search (and pop the keyboard) immediately.
JS callback: el.renderOptionContentCallback = (item, ctx) => … reads ctx.isFullscreen
The render-callback context now carries the resolved presentation
(isFullscreen / isModal), so one callback can draw a rich row on the
desktop dropdown and a leaner one in the phone sheet — no matchMedia/resize wiring.
picker.renderOptionContentCallback = (item, ctx) => ctx.isFullscreen ? leanRow(item) : richRow(item);
dir="rtl" (on the element or any ancestor)
The whole component mirrors via CSS logical properties — the input, dropdown, checkboxes,
badges, and the fullscreen overlay chrome. Runtime dir switching re-mirrors the
live picker without a rebuild.
collapse_badges_below is a different axis from
mobile_presentation. It keys off the element's own border box
(via a shared ResizeObserver), not the viewport — so a picker in a narrow column
collapses its badges to the count mode ("N selected") even on a wide monitor,
where a viewport check would read "desktop". Widening the box past the threshold restores the
configured badges mode. The two axes compose.
collapse_badges_below={360}
Drag the resize handle at the box's corner: below 360px wide the badges collapse to a count.
| Axis | Keys off | Decides |
|---|---|---|
mobile_presentation |
the device (touch + shorter viewport side < 600px) | floating panel vs. full-screen overlay |
collapse_badges_below |
the element's own border box | full badges vs. a "N selected" count |
(pick an option anywhere on this page)