carbon-addons-iot-react
carbon-addons-iot-react copied to clipboard
[StatefulTable] The filter do not work if I select empty string as the filter text
What package is this for?
- [x] React
- [ ] Angular
Describe the bug
The filtering is enabled for the StatefulTable. When I enter or choose an empty string "" as a filter, nothing happened. the filter not work. But when I click on the filter selector, it shows the empty string is selected ( see the screen shot ).
To Reproduce
Steps to reproduce the behavior:
- Prepare the data, there should be one column contains value with empty string "".
- Add filterable columns, there should be one filter is empty string.
- Apply the filter with empty string.
- Nothing happened.
Please create a reduced test case in CodeSandbox: https://codesandbox.io/s/github/carbon-design-system/carbon-addons-iot-react/tree/next/packages/react/examples/codesandbox
Expected behavior
When select the empty string filter on a column, the table should show only the rows with empty value on that column.
Environment/versions:
OS: MacOS Browser: chrome carbon-addons-iot-react version: 2.148.0
@dianatran18 @wevinkeaver Do we have a design for choosing empty strings in a filter? I think we will need to at least provide some sort of verbiage for empty string or perhaps undefined. Not sure if this use case works with undefined vs. empty string. @wanghder can you comment on this?
@dianatran18 @wevinkeaver Just giving this a bump.
Sorry for the delay on this.
When I spoke with our content designer Robin, she mentioned that "Unspecified" was used in Maximo for empty cells, so if this is for Maximo it would be good to be consistent. There isn't a one-size fits all solution to empty field/cell use cases, so it usually depends on the context. Other options in addition to "Unspecified" that she's seen are "None, "Not available" and "Not applicable", but it depends on the situation on why the data is not available, or if the user should have input something but didn't.
All-in-all, let's go with "Unspecified" for now, especially if this is for Maximo. You can see the old thread on this here