fix(admin): DOM dropdown fallback so selects work in the desktop webview embed - #608
Merged
Conversation
…iew embed The desktop client embeds the web admin console in a composited/visual-hosting webview that cannot paint the OS-drawn popup of a native <select>, so clicking any dropdown in the embedded console does nothing. All ~53 selects were affected; in a normal browser they work fine. Add one small, reusable shim to admin.html that activates only when the console is embedded (body.embedded, set by bootSSO from ?embedded=1 / #embed=1 - the same isEmbedded() signal the rest of the file already uses). It installs a single delegated capture-phase mousedown/keydown interceptor on document, so it covers dynamically-added selects (camera editor, notifications, wizard) with no per-select wiring. On opening a select in embed mode it preventDefault()s the dead native popup and renders a DOM overlay listing that select's options, positioned under the control (flipping above / clamping into the viewport). Choosing an option marks the option selected and dispatches real bubbling input and change events, so every existing onchange= handler and .value read keeps working unchanged. The native <select> stays in the DOM (its closed state paints fine and holds the value); only the popup is replaced. Closes on selection, outside click, Esc, scroll and resize; supports keyboard open/nav/commit; respects disabled selects and disabled options; renders optgroup labels. In a normal browser isEmbedded() is false and the whole shim is inert. Signed-off-by: badbread <badbread@users.noreply.github.com>
badbread
added a commit
that referenced
this pull request
Aug 9, 2026
Bring the [0.2.0] UNRELEASED section current with the final PRs merged after the previous changelog pass: the release version-drift guard (#605), the fresh-install-audit fixes (#606), the Android playback-wall intensity batching (#607), and the desktop-webview embedded-dropdown fix (#608). Added to Fixed and to All merged changes. Still UNRELEASED; dating the header is the release step. Signed-off-by: badbread <badbread@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bug
The desktop client embeds the web admin console (
services/api/src/admin.html) in awebview_windowswebview that runs in visual-hosting / composited mode. That mode cannot display the OS-drawn popup of a native<select>, so clicking any dropdown in the embedded server-settings console does nothing. All ~53<select>elements are affected. In a normal browser they work fine; only the desktop embed is broken.The fix: an embed-only DOM-dropdown shim
Rather than rewrite 53 selects, this adds one small, reusable shim to
admin.html:isEmbedded()helper (body.embedded, set bybootSSOfrom?embedded=1and/or#embed=1) that the rest of the file already uses. In a normal browser the shim is completely inert and native selects stay native.mousedown/keydowninterceptor ondocumentcovers selects added dynamically (camera editor, notifications pane, wizard) for free.preventDefault()s the dead native popup and renders a DOM overlay of that select's options, positioned under the control (flips above / clamps into the viewport). The native<select>stays in the DOM: its closed state paints fine and holds the value.selectedand dispatches real bubblinginput+changeevents, so every existingonchange=handler and.valueread keeps working untouched.<optgroup>labels (none in the file today, but handled).--surface2,--border2,--accent-soft,--accent,--shadow-lg).Verification
<script>and rannode --check(passes).crumb-apion the dev box with the modifiedadmin.html(green;include_str!embed intact).preventDefaultof the native popup, option select firingchangeand updating.value, preselected-value highlight, disabled option not selectable, disabled select not opening, optgroup rendering, outside-click / Esc / scroll close, keyboard open+nav+commit, and confirmed it is fully inert (nopreventDefault, no overlay) whenbody.embeddedis absent.How to verify in a plain browser
Load
http://<host>:8080/admin?embedded=1#embed=1, then open any dropdown in Server Settings. It should open as a DOM list (not the native popup), and picking an option should update the setting (the underlyingchangehandler fires and persists). Loading/adminwithout the embed flag keeps native selects unchanged.