Skip to content
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

[Bug]: Empty String value unable to select in multi select dropdown(FilterableMultiSelect) component #18272

Open
2 tasks done
durgamounikaJ opened this issue Dec 23, 2024 · 1 comment

Comments

@durgamounikaJ
Copy link

Package

@carbon/react

Browser

Chrome, Firefox, Edge

Package version

v1.69.0

React version

v18.2.0

Description

When a list of item being pass to component FilterableMultiSelect as items props, unable to select empty string from list of item.
Example of items:
const options = ['Item 1', 'Item 2', 'Item 3', '']; unable to select last value(Empty string).

Reproduction/example

https://stackblitz.com/edit/github-izkntc-uub7q4c1

Steps to reproduce

Create a list of string including empty string ('') and use component FilterableMultiSelect to render and try to select empty value string.

Suggested Severity

Severity 2 = User cannot complete task, and/or no workaround within the user experience of a given component.

Application/PAL

No response

Code of Conduct

@cknabe
Copy link
Contributor

cknabe commented Jan 10, 2025

The empty item is not making it past here: https://github.com/carbon-design-system/carbon/blob/main/packages/react/src/components/MultiSelect/FilterableMultiSelect.tsx#L572

I would probably go with the idea that the consumer should be filtering out empty strings instead of relying on the library to do it. If anything, I think Carbon should drop falsey strings and not make any attempt to show them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ⏱ Backlog
Development

No branches or pull requests

3 participants