Skip to content

fix: restore initial controlled ComboBox selection#21999

Open
adamalston wants to merge 1 commit intocarbon-design-system:mainfrom
adamalston:n/a-combo-box
Open

fix: restore initial controlled ComboBox selection#21999
adamalston wants to merge 1 commit intocarbon-design-system:mainfrom
adamalston:n/a-combo-box

Conversation

@adamalston
Copy link
Copy Markdown
Contributor

No issue.

Restored initial controlled ComboBox selection.

Changelog

Changed

  • Restored initial controlled ComboBox selection.

Testing / Reviewing

When the component is initially rendered with a selectedItem prop, clearing the field or entering an invalid value does not revert to the previously selected value. After making a new selection, the behavior works as expected, suggesting the issue only occurs on initial load.

Using initialSelectedItem produces the expected behavior, but passing both initialSelectedItem and selectedItem isn't appropriate since they represent uncontrolled and controlled usage, respectively.

The issue can be reproduced in the Storybook: https://react.carbondesignsystem.com/?path=/docs/components-combobox--overview#selecteditem.

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 11, 2026

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit a771710
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69da5dd0a10a0c00099e2404
😎 Deploy Preview https://deploy-preview-21999--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Apr 11, 2026

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit a771710
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69da5dd0affe9e0008a7b7f7
😎 Deploy Preview https://deploy-preview-21999--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 11, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.93%. Comparing base (597001a) to head (a771710).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21999      +/-   ##
==========================================
+ Coverage   94.90%   94.93%   +0.02%     
==========================================
  Files         541      541              
  Lines       45253    45255       +2     
  Branches     6359     6361       +2     
==========================================
+ Hits        42949    42964      +15     
+ Misses       2172     2159      -13     
  Partials      132      132              
Flag Coverage Δ
main-packages 89.17% <100.00%> (+<0.01%) ⬆️
web-components 97.70% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Member

@sangeethababu9223 sangeethababu9223 left a comment

Choose a reason for hiding this comment

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

LGTM!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants