Skip to content

Commit

Permalink
fix(statefultable): ensure defaults for spread view props
Browse files Browse the repository at this point in the history
  • Loading branch information
tay1orjones committed Jul 28, 2020
1 parent 670e5e2 commit 941e3fb
Show file tree
Hide file tree
Showing 3 changed files with 132 additions and 72 deletions.
7 changes: 4 additions & 3 deletions src/components/Table/StatefulTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ const StatefulTable = ({ data: initialData, expandedData, ...other }) => {
view,
view: {
table: { filteredData, selectedIds, sort },
toolbar: { initialDefaultSearch },
},
} = state;

const initialDefaultSearch = state?.table?.toolbar?.initialDefaultSearch || '';

const { pagination, toolbar, table } = callbackActions;
const { onChangePage } = pagination || {};
const {
Expand Down Expand Up @@ -227,9 +228,9 @@ const StatefulTable = ({ data: initialData, expandedData, ...other }) => {
view={{
...view,
toolbar: {
...view.toolbar,
...view?.toolbar,
search: {
...view.toolbar.search,
...view?.toolbar?.search,
defaultValue: initialDefaultSearch,
},
},
Expand Down
Loading

0 comments on commit 941e3fb

Please sign in to comment.