carbon-addons-iot-react icon indicating copy to clipboard operation
carbon-addons-iot-react copied to clipboard

[StatefulTable] The filter do not work if I select empty string as the filter text

Open wanghder opened this issue 3 years ago • 3 comments

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 ).

image image

To Reproduce

Steps to reproduce the behavior:

  1. Prepare the data, there should be one column contains value with empty string "".
  2. Add filterable columns, there should be one filter is empty string.
  3. Apply the filter with empty string.
  4. 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

wanghder avatar Aug 31 '22 06:08 wanghder

@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?

davidicus avatar Sep 19 '22 13:09 davidicus

@dianatran18 @wevinkeaver Just giving this a bump.

davidicus avatar Oct 12 '22 13:10 davidicus

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

dianasanborn avatar Oct 12 '22 13:10 dianasanborn