Skip to content
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

fix: update compareItems type in MultiSelect #18599

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

adamalston
Copy link
Contributor

@adamalston adamalston commented Feb 15, 2025

Closes #18199

Updated compareItems type in MultiSelect.

Changelog

New

  • Added defaultCompareItems tests.

Changed

  • Updated compareItems type in MultiSelect.

Testing / Reviewing

  • Run the test that was added.
  • Use compareItems in a TypeScript file similar to the reproduction in the issue and check for errors.

Copy link

netlify bot commented Feb 15, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit fe93944
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/67b113c850ca9a000892c6ce
😎 Deploy Preview https://deploy-preview-18599--carbon-elements.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 Feb 15, 2025

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

Name Link
🔨 Latest commit fe93944
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-web-components/deploys/67b113c8fa76980008f1965b
😎 Deploy Preview https://deploy-preview-18599--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 Feb 15, 2025

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit fe93944
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/67b113c85582720008bf72a7
😎 Deploy Preview https://deploy-preview-18599--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 Feb 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.02%. Comparing base (494ab2e) to head (fe93944).
Report is 13 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18599   +/-   ##
=======================================
  Coverage   84.02%   84.02%           
=======================================
  Files         408      408           
  Lines       14494    14494           
  Branches     4726     4676   -50     
=======================================
  Hits        12178    12178           
  Misses       2150     2150           
  Partials      166      166           

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

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

One question but nothing to hold up a merge. Thanks for this contribution!

@@ -46,14 +46,14 @@ interface SharedOptions {
locale: string;
}

interface CompareItems {
(itemA: string, itemB: string, options: SharedOptions): number;
Copy link
Member

Choose a reason for hiding this comment

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

Are we losing some strictness here by moving the items from ItemType to string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Wasn't that the problem, that the items had type ItemType instead of string? Aren't the items going through itemToString before they go to the comparison function?

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]: MultiSelect compareItems parameter types are not correct
2 participants