carbon-addons-iot-react
carbon-addons-iot-react copied to clipboard
[table] search callbacks not working
What package is this for?
- [x] React
- [ ] Angular
Describe the bug
The Table search prop has two callbacks defined in the PropTypes definition and also mentioned in the documentation that do not work. It is the view.toolbar.search.onChange and the view.toolbar.search.onExpand. The onChange is overwritten in the TableToolbar.jsx and never works. The view.toolbar.search.onExpand works for the Table but not for the StatefulTable where the whole prop object view.toolbar.search is modified and the callbacks lost.
What strikes me here is that these callbacks should never have been placed in the view prop to begin with, they belong in the actions prop.
To Reproduce
Steps to reproduce the behavior:
Modify a Table story with search and try to use these callbacks
Expected behavior
- Not sure if we need or should expose the
onChangesince we already have theonApplySearchwith theoptions.hasFastSearchthat currently handles the different search scenarios. The callback should probably just be removed in order to not cause confusion or future bugs. - The
view.toolbar.search.onExpandshould be deprecated and a new proponSearchExpandshould be added to theactions.toolbarprop instead. This prop should work for both the Table and the StatefulTable - Docs and stories must be updated
Environment/versions:
- OS: [e.g. MacOS, Windows]
- Browser: [e.g. chrome, safari]
carbon-addons-iot-reactversion: [e.g.v2.60.0]
Additional context
If applicable, add screenshots to help explain your problem.
Add any other context about the problem here.
Specific timeline issues / requests
Do you want this work within a specific time period? Is it related to an upcoming release?
NB: The core contributors will try to work with your timeline, but it's not guaranteed. The earlier you make a request in advance of a desired delivery date, the better!
@davidicus Do you agree with the expected behavior?