gregnb / gregnb/mui-datatables
Custom Search Field Bug
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 906
- PR merge metrics
- No merged PRs in 30d
Description
## Expected Behavior
The parent component contains some of the option ( column, data, options). The child component should receive those options of the parent component and add the functionality of the search bar:
Child:
```
const [searchText, setSearchText] = useState('');
const tbOptions = {
...props.options,
searchText: searchText,
customSearch: (searchQuery, currentRow, columns) => { github's examples code }
}
return (
)
```
## Current Behavior
The search doesn't work. But if you elevate the code at the parent component it works like a charm.
## Your Environment
| Tech | Version |
|--------------|---------|
| Material-UI | ^4.8.3 |
| MUI-datatables | ^2.13.3 |
| React | 6.12.0|
| browser | Chrome |
| etc | |
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the parent and child component setup described in the issue with MUI-datatables 2.13.3 and React. Trace how the child passes options and searchText into MUIDataTable, then verify that customSearch runs and filtering works without moving the code to the parent.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100