anomalyco / anomalyco/opencode

SelectV2 dropdown fails to open after selecting an item (Kobalte Portal rendering bug)

Open
#38,621 4 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Jul 24, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

Description

After selecting an option from a SelectV2 dropdown (language, theme, color scheme, shell), the next click on the trigger does not render the dropdown popover. The trigger's onClick fires, onOpenChange(true) fires, but the <Kobalte.Content> / <Kobalte.Listbox> never appears in the DOM. Re-clicking eventually recovers but only after several attempts.

Also reproducible on the official desktop .exe build, confirming this is an upstream shared issue, not specific to any deployment target.

Steps to Reproduce

  1. Open Settings → General
  2. Click any SelectV2 (Language / Shell / Color Scheme / Theme)
  3. Select an option from the list
  4. Click the same SelectV2 trigger again
  5. Expected: Dropdown opens normally
  6. Actual: Nothing appears (or flickers briefly)

Happens 100% of the time on the 2nd open after item selection.

Diagnostic Evidence

With a DOM probe added after onOpenChange(true):

[select-v2] POPOVER MISSING action=settings-language elapsed=1986ms cycle=4
[select-v2] diagnostics: portalInDom=false triggerExpanded=false listboxInDom=false
  • portalInDom=false — Kobalte's <Portal> is not mounting content to document.body
  • triggerExpanded=false — even though onOpenChange(true) was called, trigger's data-expanded attribute is not set
  • listboxInDom=false — no drop-down list in the DOM at all

Root Cause

Kobalte's <Portal> component enters a broken state after the first onChange (item selection). On the next open, onOpenChange(true) fires correctly (the state machine works), but <Kobalte.Content> / <Kobalte.Listbox> are never rendered into the portal. This only happens after an item has been selected — pure open/close without selection does not trigger the bug.

Environment

  • @kobalte/core version: 0.13.x (per workspace catalog)
  • SolidJS version: 1.9.x (per workspace catalog)
  • Browser: Any (reproduced in Chrome)
  • OS: Windows (Docker-hosted instance)

Workaround

Forcing Kobalte to unmount/remount after every item selection resolves the issue:

// In SelectV2 component:
const [_mounted, setMounted] = createSignal(true)
const remountKobalte = () => {
  setMounted(false)
  requestAnimationFrame(() => setMounted(true))
}

// In JSX:
<Show when={_mounted()}>
  <Kobalte ...>
</Show>

// In onChange:
onChange={(next) => {
  const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
  local.onSelect?.(v)
  stop()
  setTimeout(remountKobalte, 0)  // force fresh instance after selection
}}
Plugins

No response

OpenCode version

No response

Steps to reproduce

[select-v2] POPOVER MISSING action=settings-language elapsed=1986ms cycle=4
[select-v2] diagnostics: portalInDom=false triggerExpanded=false listboxInDom=false

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.