anomalyco / anomalyco/opencode

fix(ui): all dropdown selects stop opening after first selection in settings

Open
#39,455 2 comments 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Jul 29, 2026.

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

Description

Description

All dropdown selects (theme, color scheme, language, shell, sound, etc.) in the settings dialog stop responding after a value is selected. After choosing an item, clicking the trigger again does not open the dropdown — it remains closed with no response.

Steps to reproduce
  1. Open the settings dialog
  2. Click any dropdown (e.g. Theme, Color Scheme, Language)
  3. Select an item from the list — the dropdown closes and the value updates
  4. Click the same dropdown trigger again
  5. The dropdown does not open
Cause

In packages/ui/src/v2/components/select-v2.tsx and packages/ui/src/components/select.tsx, the onChange handler calls the user's onSelect callback synchronously before Kobalte's internal close() runs. For selects that trigger reactive state updates (e.g. theme.setTheme()), the SolidJS store update is batched together with the close() signal. When the batch flushes, the theme CSS application (modifying <style> element textContent) and the dropdown close animation/portal cleanup happen in the same microtask, leaving Kobalte's internal state inconsistent and preventing subsequent opens.

Fix

Defer onSelect via queueMicrotask so Kobalte fully completes selection handling (close(), portal cleanup) before the reactive update runs:

// Before (select-v2.tsx:166-170)
onChange={(next) => {
  const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
  local.onSelect?.(v)
  stop()
}}

// After
onChange={(next) => {
  const v = next == null ? null : Array.isArray(next) ? ((next[0] as T) ?? null) : (next as T)
  queueMicrotask(() => local.onSelect?.(v))
  stop()
}}

Same fix applies to the legacy Select component in packages/ui/src/components/select.tsx:126-129.

Operating System

macOS

OpenCode version

Latest dev branch

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.