Skip to content

refactor(select): use Base UI native placeholder prop#172

Merged
geoquant merged 2 commits intocloudflare:mainfrom
invisal:refactor/select-placeholder
Mar 4, 2026
Merged

refactor(select): use Base UI native placeholder prop#172
geoquant merged 2 commits intocloudflare:mainfrom
invisal:refactor/select-placeholder

Conversation

@invisal
Copy link
Contributor

@invisal invisal commented Mar 4, 2026

Summary

Since we have upgraded to BaseUI to 1.2.0, we can now use the native placeholder (https://base-ui.com/react/overview/releases/v1-1-0#select). This simplifies the Select component's implementation by removing the need to manually inject placeholder items into the items array.

Benefits

  • Cleaner API: More intuitive placeholder API that aligns with standard HTML select behavior
  • Reduced complexity: Removes placeholder item injection logic from the Select component
  • Backward compatible: Maintains support for the null-value placeholder pattern
  • Better filtering: Automatically filters null-value items from auto-rendered options

Changes

  • Added placeholder prop support to Select.Value component
  • Removed manual placeholder item injection logic
  • Added comprehensive test coverage for placeholder functionality
  • Updated documentation to show both placeholder approaches
  • Added changeset for patch release

Testing

  • ✅ Comprehensive test suite covering all placeholder scenarios
  • ✅ Both placeholder prop and null-value item patterns tested
  • ✅ Controlled component behavior verified

invisal and others added 2 commits March 4, 2026 10:37
Simplify Select placeholder implementation by using Base UI's native placeholder prop on SelectBase.Value instead of manually injecting placeholder items into the items array. This provides a cleaner, more intuitive API that aligns with standard HTML select behavior while maintaining backward compatibility with the null-value placeholder pattern.

Changes:
- Add placeholder prop support to Select.Value component
- Remove placeholder item injection logic from Select component
- Add comprehensive tests for placeholder functionality
- Update documentation with both placeholder approaches
- Filter null-value items from auto-rendered options
@pkg-pr-new
Copy link

pkg-pr-new bot commented Mar 4, 2026

npm i https://pkg.pr.new/@cloudflare/kumo@172

commit: 59467a9

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Docs Preview

View docs preview

Commit: e39738d

@mattrothenberg
Copy link
Collaborator

Awesome! This is a great improvement.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

Visual Regression Report

13 screenshot(s) with visual changes:

Button / Loading State

0 px (0%) changed

Before After Diff
Before After Diff

Dialog / Alert Dialog (role="alertdialog")

33,241 px (0.63%) changed

Before After Diff
Before After Diff

Dialog / With Combobox

153,623 px (2.93%) changed

Before After Diff
Before After Diff

Dialog / With Dropdown

154,846 px (2.95%) changed

Before After Diff
Before After Diff

Select / Basic Usage

379,150 px (40.38%) changed

Before After Diff
Before After Diff

Select / Basic Label and Value

16,154 px (1.62%) changed

Before After Diff
Before After Diff

Select / Placeholder

380,935 px (36.74%) changed

Before After Diff
Before After Diff

Select / Custom Rendering

0 px (0%) changed

Before After Diff
Before After Diff

Select / Loading

258 px (0.04%) changed

Before After Diff
Before After Diff

Select / Multiple Item

0 px (0%) changed

Before After Diff
Before After Diff

Select / More Example

0 px (0%) changed

Before After Diff
Before After Diff

Select / Select.Option

24,948 px (2.91%) changed

Before After Diff
Before After Diff

Select (Open)

1,338,837 px (10.63%) changed

Before After Diff
Before After Diff
11 screenshot(s) unchanged
  • Button / Variants
  • Button / Sizes
  • Button / With Icon
  • Button / Icon Only
  • Button / Disabled State
  • Dialog / Basic Dialog
  • Dialog / Confirmation Dialog (with disablePointerDismissal)
  • Dialog / With Actions
  • Dialog / With Select
  • Dialog (Open)
  • Select / Select

Generated by Kumo Visual Regression

@geoquant geoquant merged commit c0341b4 into cloudflare:main Mar 4, 2026
7 checks passed
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.

3 participants