Skip to content

fix(NcRadioGroup): share one name between NcRadioGroupButton inputs - #9291

Open
bycorekci wants to merge 1 commit into
nextcloud-libraries:mainfrom
bycorekci:fix/radio-group-name-9278
Open

bycorekci wants to merge 1 commit into
nextcloud-libraries:mainfrom
bycorekci:fix/radio-group-name-9278

Conversation

@bycorekci

Copy link
Copy Markdown

☑️ Resolves

🚧 Tasks

  • NcRadioGroup generates a unique name (new optional name prop to override it) and provides it through the radio group context.
  • NcRadioGroupButton binds it on its <input type="radio">, so the options form one native radio group (one tab stop, arrow keys move the selection).
  • Unit tests in tests/unit/components/NcRadioGroup check the shared name, distinct names per group and the name prop; they fail without the change.

🏁 Checklist

  • ⛑️ Tests are included or are not applicable
  • 📘 Component documentation has been extended, updated or is not applicable
  • 2️⃣ Backport to stable8 for maintained Vue 2 version or not applicable

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Without a common name the browser does not treat the radio inputs as one group, so every option is a separate tab stop and arrow keys do not move the selection. NcRadioGroup now provides a generated name (overridable with a new name prop) and NcRadioGroupButton binds it on its input.

Assisted-by: DeepSeek:V4.1-Flash

Assisted-by: Claude-Code:claude-sonnet-5-5
Signed-off-by: Bycorekci <18033711+Bycorekci@users.noreply.github.com>
@bycorekci
bycorekci requested a review from a team as a code owner December 3, 2026 10:51

@susnux susnux left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

makes sense!

@susnux
susnux requested a review from a team December 3, 2026 11:06
@susnux susnux added bug Something isn't working 3. to review Waiting for reviews labels Dec 3, 2026
@codecov

codecov Bot commented Dec 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 62.73%. Comparing base (09553f5) to head (5195a27).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9291      +/-   ##
==========================================
+ Coverage   62.63%   62.73%   +0.09%     
==========================================
  Files         131      134       +3     
  Lines        4791     4836      +45     
  Branches     1449     1468      +19     
==========================================
+ Hits         3001     3034      +33     
- Misses       1527     1538      +11     
- Partials      263      264       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

3. to review Waiting for reviews bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NcRadioGroup: radio buttons don't share a name (no arrow-key navigation)

2 participants