Skip to content

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

Open
rastuhacode wants to merge 4 commits intounovue:v2from
rastuhacode:feat/add-select-id-2548
Open

feat(Select): add 'id' prop to SelectRoot and BubbleSelect components#2569
rastuhacode wants to merge 4 commits intounovue: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 now accepts an optional id prop, allowing a custom id attribute on rendered select elements.
  • Documentation

    • Documentation 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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 90a2d590-e7cc-4107-8b5a-94dd21f12f88

📥 Commits

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

📒 Files selected for processing (1)
  • packages/core/src/Select/SelectRoot.vue
🚧 Files skipped from review as they are similar to previous changes (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

Cohort / File(s) Summary
Documentation
docs/content/meta/SelectRoot.md
Added id prop (type string) to SelectRoot props table.
Select components
packages/core/src/Select/SelectRoot.vue, packages/core/src/Select/BubbleSelect.vue
Introduced optional id?: string prop on SelectRootProps and BubbleSelectProps; id is extracted in SelectRoot and forwarded to BubbleSelect, and ultimately applied to the native <select>; render condition updated to allow mounting when id is present.
Story
packages/core/src/Select/story/SelectForm.story.vue
Added id="fruit" to the SelectRoot story to showcase the new prop.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

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 directly and clearly describes the main change: adding an 'id' prop to SelectRoot and BubbleSelect components, which is the primary focus of this PR.
Linked Issues check ✅ Passed The PR successfully adds id prop support to SelectRoot and BubbleSelect components, updates documentation, and demonstrates the fix in the story component, directly resolving the stated accessibility issue.
Out of Scope Changes check ✅ Passed All changes are directly related to adding id prop support: component implementation in SelectRoot and BubbleSelect, documentation updates, and story demonstration. No unrelated modifications detected.
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: 4ed63ba

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 Outdated
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