-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
base: main
Are you sure you want to change the base?
fix: update compareItems type in MultiSelect #18599
Conversation
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
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. |
There was a problem hiding this 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; |
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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?
Closes #18199
Updated
compareItems
type inMultiSelect
.Changelog
New
defaultCompareItems
tests.Changed
compareItems
type inMultiSelect
.Testing / Reviewing
compareItems
in a TypeScript file similar to the reproduction in the issue and check for errors.