Skip to content

fix(MultiSelect): update types #19241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

adamalston
Copy link
Contributor

@adamalston adamalston commented Apr 26, 2025

Closes #19242

Fixed MultiSelect types.

Changelog

New

  • Added types for displayName and propTypes to the component interface.

Changed

  • Fixed MultiSelect types.

Testing / Reviewing

Paste the following code in packages/react/src/components/MultiSelect/index.tsx or any typescript file in the project and check that there are no errors.

import { MultiSelect } from './MultiSelect';

const Component = () => {
  return (
    <MultiSelect
      id={''}
      items={[
        { name: 'one', value: 'one' },
        { name: 'two', value: 'two' },
        { name: 'three', value: 'three' },
      ]}
      selectedItems={[{ name: 'one', value: 'one' }]}
      itemToString={(item) => (item ? item.name : '')}
      itemToElement={({ name, value }) => (
        <div>
          {name} {value}
        </div>
      )}
      label={''}
    />
  );
};

Copy link

netlify bot commented Apr 26, 2025

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

Name Link
🔨 Latest commit 57df9e7
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/680d047e9e96970008252e0e
😎 Deploy Preview https://deploy-preview-19241--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 site configuration.

Copy link

netlify bot commented Apr 26, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 57df9e7
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/680d047ec0ac1d00084c5356
😎 Deploy Preview https://deploy-preview-19241--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 site configuration.

Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.41%. Comparing base (1dcc965) to head (57df9e7).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #19241      +/-   ##
==========================================
- Coverage   84.44%   84.41%   -0.03%     
==========================================
  Files         385      385              
  Lines       14563    14563              
  Branches     4806     4806              
==========================================
- Hits        12297    12294       -3     
- Misses       2106     2110       +4     
+ Partials      160      159       -1     

☔ 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.

@adamalston adamalston marked this pull request as ready for review April 26, 2025 16:27
@adamalston adamalston requested review from a team as code owners April 26, 2025 16:27
Copy link
Member

@alisonjoseph alisonjoseph left a comment

Choose a reason for hiding this comment

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

LGTM!

@alisonjoseph alisonjoseph added this pull request to the merge queue Apr 29, 2025
Merged via the queue into carbon-design-system:main with commit 4ff4a11 Apr 29, 2025
53 of 54 checks passed
@adamalston adamalston deleted the n/a-multi-select branch April 29, 2025 20:41
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.

[Bug]: Regression in MultiSelect typescript annotations
3 participants