carbon-design-system / carbon

A design system built by IBM
https://www.carbondesignsystem.com
Apache License 2.0
7.86k stars 1.82k forks source link

[Bug]: filterItems prop in FilterableMultiSelect should be optional #16993

Open guidari opened 4 months ago

guidari commented 4 months ago

Package

@carbon/react

Browser

No response

Package version

v11.62.0

React version

18.02

Description

The option filterItems should be optional and also added to the FilterableMultiSelect.propTypes.

It should show the props in the Overview page. Screenshot 2024-07-18 at 10 49 55

Reproduction/example

https://react.carbondesignsystem.com/?path=/docs/components-multiselect--overview

Steps to reproduce

Prop is required in typescript code

Suggested Severity

Severity 3 = User can complete task, and/or has a workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

jesnajoseijk commented 3 months ago

Hi @guidari could you assign it me so that I can work on it

ecrvich commented 1 month ago

Still seeing the TS error in Carbon 1.66.0. Is anything happening with this? It's been a couple months...

Simply adding a question mark to the function name in FilterableMultiSelect.d.ts fixes the error:

image

And then add something like this to propTypes in FilterableMultiSelect.js:

  /**
   * Optional function to filter the items based on the text
   * entered by the user.
   */
  filterItems: PropTypes__default["default"].func,
guidari commented 1 month ago

Hey @ecrvich Looks like the previous assignee didn't get to the issue, so I just removed it. Feel free to open a PR if you want!