srigar / multiselect-react-dropdown

React multiselect dropdown with search and various options
https://10xn41w767.codesandbox.io/
MIT License
200 stars 114 forks source link

TypeError: Cannot read properties of null (reading 'removeEventListener') at Multiselect.componentWillUnmount #208

Open rachanabasnet1 opened 2 years ago

rachanabasnet1 commented 2 years ago

I am currently using multiselect-react-dropdown version 2.0.21 and react version 18.0.0. I integrated a multi-select dropdown in one of the forms and when I try to leave the page where the multi-select component is integrated and "TypeError: Cannot read properties of null (reading 'removeEventListener') at Multiselect.componentWillUnmount" error pops up on the console and the screen goes blank.

<Multiselect options={options} name="particulars" onSelect={onSelectParticulars} onRemove={onRemoveParticulars} displayValue="name" closeIcon="cancel" placeholder="Select Particulars" selectedValues={particulars} className="multiSelectContainer" />

This is the error I received on the console: Screenshot from 2022-05-16 09-41-06

anand-gautam-mangoscience commented 2 years ago

I am too facing this issue, Is your react app version is 18

rachanabasnet1 commented 2 years ago

I am too facing this issue, Is your react app version is 18

Yes, my react app version is 18.0.0

anand-gautam-mangoscience commented 2 years ago

The Issue seems to appear only in React18.

anand-gautam-mangoscience commented 2 years ago

Did you get any fix for that yet?