Carbon: [TableToolbarSearch] `value` overwritten by empty state

Created on 25 Jun 2019  路  4Comments  路  Source: carbon-design-system/carbon

What package(s) are you using?

  • [ ] carbon-components
  • [x] carbon-components-react v7.3.2

Detailed description

I鈥檓 trying to set a default value for the DataTable / TableToolbarSearch input field. Usually the props are passed down to the child components. In this case it鈥檚 the Search component, which offers the defaultValue and value. Unfortunately the TableToolbarSearch component initializes the value property by setting an empty state. Therefore, I can鈥檛 set a default value.

Related code line:
https://github.com/carbon-design-system/carbon/blob/3dabe8fd1272896f7c7d33ab2a451c7e15f5f90f/packages/react/src/components/DataTable/TableToolbarSearch.js#L46

Steps to reproduce the issue

Edit codesandbox

Additional information

Note: The Sandbox contains a little CSS bug fix for persistant mode, which I've described in #3108 already:

      .bx--table-toolbar
        .bx--toolbar-action.bx--toolbar-search-container-persistant {
        width: 100%;
      }
help wanted 馃憪 bug 馃悰

Most helpful comment

@mattrosno Any progress on this issue? It is affecting our adoption of Carbon in IBM Cloud.

All 4 comments

@mattrosno Any progress on this issue? It is affecting our adoption of Carbon in IBM Cloud.

@IOIO72 were you able to implement a workaround for this regression?

@IdanAdar I just added a PR that should fix this issue if you want to take a look: https://github.com/carbon-design-system/carbon/pull/5089

@tw15egan what is the ETA on this?

Was this page helpful?
0 / 5 - 0 ratings