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
MultiSelect - breaking when options is empty array #2496
Comments
Please provide a Code Sandbox reproducer so we can debug. |
I'm unable to reproduce it in the code sandbox... any heads up on how I can debug this on my side.. Error message: Uncaught TypeError: Cannot read properties of null (reading 'length') |
OK two things.
|
Closing because I'm unable to reproduce the issue in sandbox. |
Reopening this issue. Able to reproduce the issue in sandbox : https://codesandbox.io/s/primereact-test-forked-0rbtt?file=/src/index.js Choosing the first option will show the error and choosing the second option will show how it should look like but with multiselect instead of dropdown. Similar issue was seen in PrimeNG, I believe : primefaces/primeng#7941 |
Thanks for the reproducer. Let me take a look! |
I'm submitting a ... (check one with "x")
Current behavior
I have a MultiSelect component being generated depending on a switch case. The options values are being generated programmatically in useEffect.
However, the Multiselect is breaking for the generated options. It works fine if I provide a hardcoded value. The same generated values are working when given to a Dropdown component.
Error message: TypeError: Cannot read properties of null (reading 'length')
at MultiSelect.isAllSelected
Expected behavior
Expecting Multiselect to not break for programmatically generated options set.
Help...
React version:
17.0.2
PrimeReact version:
6.5.1
The text was updated successfully, but these errors were encountered: