carbon-design-system / carbon

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

[Bug]: FilterableMultiSelect throw console error when 1st time click and select/unselect the value #16849

Open ambrishsinghibm opened 1 month ago

ambrishsinghibm commented 1 month ago

Package

@carbon/react

Browser

Chrome, Firefox

Package version

v1.60.2

React version

18.2.0

Description

Hi Team, I have integrated the latest carbon/react library in my application and using the FilterableMultiSelect control. After page load, if select/un-select the value from the control, it's throwing the console error as below

Warning: Cannot update a component (ContextProvider) while rendering a different component (ForwardRef(FilterableMultiSelect)). To locate the bad setState() call insideForwardRef(FilterableMultiSelect), follow the stack trace as described in https://reactjs.org/link/setstate-in-render

I observed the same issue in "MultiSelect" drop down as well. here are the defect details https://github.com/carbon-design-system/carbon/issues/15758 Please provide the solution for this. Let me know if you need any other details

Thanks

Reproduction/example

https://stackblitz.com/edit/github-1ljccm-n43dwk?file=src%2FApp.jsx

Steps to reproduce

  1. Open the URL: https://stackblitz.com/edit/github-1ljccm-n43dwk?file=src%2FApp.jsx
  2. Select/un-select the value
  3. See the developer tool consol error

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

Tomahaawk commented 3 weeks ago

Same happening with in my application after upgrading carbon to @carbon/react 1.61