Skip to content

fix(select): respect read only on the trigger - #758

Open
dennev wants to merge 1 commit into
kobaltedev:mainfrom
dennev:fix/select-read-only
Open

dennev wants to merge 1 commit into
kobaltedev:mainfrom
dennev:fix/select-read-only

Conversation

@dennev

@dennev dennev commented Nov 1, 2026

Copy link
Copy Markdown

Closes #757

Select.Trigger only checked disabled, so a read-only select still opened from a press or a key, and ArrowLeft, ArrowRight and type-ahead still changed its value.

This adds a read-only check to the trigger's pointer, click and key handlers, and updates the readOnly line of the docs. Combobox disables its trigger button for this, but it keeps its input focusable. Here the trigger is the only focus target, so it stays enabled and a keyboard user can still reach it.

This covers input on the trigger only. A list opened through open or defaultOpen, the remove and clear functions of Select.Value, and browser autofill through the hidden <select> can still change the value.

The tests are in a new file because the suite in select.test.tsx is skipped. Without the change, 9 of its 19 cases fail: every read-only case except the one that checks the trigger stays focusable.

I also ran it in headless Chromium 141 with real mouse, touch and keyboard input. Without the change a press, a tap, Enter, Space, ArrowDown and ArrowUp open a read-only select, and ArrowLeft, ArrowRight and t change its value. With it, the first six leave it closed, the last three leave its value at Two, and Tab still reaches the trigger. An editable select gave the same results with and without the change.

On Linux with Node 24 the new file passes. The core suite fails intermittently with and without this change: in toggle-group on both sides, and also in aria-hide-outside and toast without it.

The same trigger code is on solid2. I can open a port there if you want one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@netlify

netlify Bot commented Nov 1, 2026

Copy link
Copy Markdown

👷 Deploy request for kobalte pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 1ea3c0b

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select: readOnly does not stop the trigger from opening or changing the value

1 participant