Skip to content

feat(Select): add 'id' prop to SelectRoot and BubbleSelect components#2569

Open
rastuhacode wants to merge 5 commits into
unovue:v2from
rastuhacode:feat/add-select-id-2548
Open

feat(Select): add 'id' prop to SelectRoot and BubbleSelect components#2569
rastuhacode wants to merge 5 commits into
unovue:v2from
rastuhacode:feat/add-select-id-2548

Conversation

@rastuhacode
Copy link
Copy Markdown
Contributor

@rastuhacode rastuhacode commented Apr 3, 2026

🔗 Linked issue

#2548

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Resolves #2548

When user passes id prop to SelectRoot it is considered attribute and being dropped out and unused. It causes accessibility browser issues when being used for ex. inside form with label for construction.

  • Added id prop support for SelectRoot and BubbleSelect components
  • Updated docs to include new prop
  • Updated SelectForm.story.vue as it had the same accessibility issue in inspector

📸 Screenshots (if appropriate)

Issue in story
image

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • New Features

    • Select component accepts an optional id prop, allowing a custom id attribute on rendered select elements.
  • Documentation

    • Docs and story examples updated to document and demonstrate the new optional id prop.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 3, 2026

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2cca4b31-55de-44ca-88b3-2da6004f542c

📥 Commits

Reviewing files that changed from the base of the PR and between 4ed63ba and d29948f.

📒 Files selected for processing (1)
  • packages/core/src/Select/SelectRoot.vue

📝 Walkthrough

Walkthrough

Adds an optional public id?: string prop to SelectRoot and BubbleSelect, forwards id to the rendered native <select>, updates documentation, and demonstrates the prop in the SelectForm story.

Changes

SelectRoot id prop

Layer / File(s) Summary
Add id prop and forward
packages/core/src/Select/SelectRoot.vue, packages/core/src/Select/BubbleSelect.vue, docs/content/meta/SelectRoot.md, packages/core/src/Select/story/SelectForm.story.vue
Introduces optional id?: string on SelectRootProps and BubbleSelectProps; SelectRoot destructures and forwards id to BubbleSelect, which applies it to the native <select>. Documentation props table updated and SelectForm story adds id="fruit".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I found a tiny tag named "id",

I nudged the props and softly slid.
From root to bubble the little bond grew,
Now labels and forms can find it too.
A hop, a bind — a tidy view.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: adding an 'id' prop to SelectRoot and BubbleSelect components.
Linked Issues check ✅ Passed The PR successfully implements the requirement from issue #2548: adding id prop support to SelectRoot and BubbleSelect components for accessibility.
Out of Scope Changes check ✅ Passed All changes directly support the stated objective of adding id prop support; the story update demonstrates the fix and documentation updates reflect the new functionality.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 3, 2026

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@2569

commit: d29948f

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/content/meta/SelectRoot.md (1)

110-122: ⚠️ Potential issue | 🟡 Minor

Documentation inconsistency: id prop missing from markdown table.

The id prop was added to the PropsTable component (lines 70-76) but is missing from the markdown props table in the llm-only section. Both documentation formats should include all props for consistency.

Add the following row after line 122:

| `id` | Id of the element | `string` | No | - |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/content/meta/SelectRoot.md` around lines 110 - 122, Add the missing `id`
prop row to the markdown props table so it matches the PropsTable component:
insert a table row for the `id` prop (label "Id of the element", type `string`,
required No, default `-`) into the existing props table in SelectRoot.md (so the
llm-only markdown and the PropsTable component are consistent); locate the props
table near the `autocomplete`/`by` entries and add the `id` row in the same
format as the other rows.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@docs/content/meta/SelectRoot.md`:
- Around line 70-76: Update the docs table to include the new "id" prop entry so
the markdown props table matches the PropsTable data; then fix SelectRoot.vue by
exposing id from props (either add id to the toRefs destructure e.g. include
`id` alongside `required, disabled, multiple, dir: propDir` or reference
`props.id` in the template) so the template binding `:id="id"` on the
BubbleSelect has a defined value and avoids the runtime undefined reference.

---

Outside diff comments:
In `@docs/content/meta/SelectRoot.md`:
- Around line 110-122: Add the missing `id` prop row to the markdown props table
so it matches the PropsTable component: insert a table row for the `id` prop
(label "Id of the element", type `string`, required No, default `-`) into the
existing props table in SelectRoot.md (so the llm-only markdown and the
PropsTable component are consistent); locate the props table near the
`autocomplete`/`by` entries and add the `id` row in the same format as the other
rows.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 49f3cb68-7395-47a8-8835-2214b18a5ff0

📥 Commits

Reviewing files that changed from the base of the PR and between 2383575 and 4e99265.

📒 Files selected for processing (1)
  • docs/content/meta/SelectRoot.md

Comment thread docs/content/meta/SelectRoot.md
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/core/src/Select/SelectRoot.vue`:
- Around line 206-207: The rendering condition for the native select
(BubbleSelect) in SelectRoot.vue currently requires name (v-if="isFormControl &&
name"), which prevents rendering when only id is provided; update the condition
to allow rendering when id exists (e.g., v-if="isFormControl && (name || id)")
so the native <select> is created and the id prop has a DOM target, and verify
the :id="id" binding on BubbleSelect remains intact.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3f131e6e-e589-4ed5-943b-4882d0ce2a35

📥 Commits

Reviewing files that changed from the base of the PR and between 4e99265 and c6a0f6b.

📒 Files selected for processing (2)
  • docs/content/meta/SelectRoot.md
  • packages/core/src/Select/SelectRoot.vue
✅ Files skipped from review due to trivial changes (1)
  • docs/content/meta/SelectRoot.md

Comment thread packages/core/src/Select/SelectRoot.vue
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.

[Bug]: <SelectRoot> does not accept id

1 participant