Skip to content

Commit

Permalink
added for schema
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 committed Mar 6, 2020
1 parent 5fb9e9a commit 568aed0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/datagrid/column_sorting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const useColumnSorting = (
): ReactNode => {
const [isOpen, setIsOpen] = useState(false);
const [avilableColumnsisOpen, setAvailableColumnsIsOpen] = useState(false);

// prune any non-existant/hidden columns from sorting
useEffect(() => {
if (sorting) {
Expand Down Expand Up @@ -227,7 +226,12 @@ export const useColumnSorting = (
const nextColumns = [...sorting.columns];
nextColumns.push({
id,
direction: defaultSortDirection || 'asc',
direction:
defaultSortDirection ||
(schemaDetails(id) &&
schemaDetails(id)!
.defaultSortDirection) ||
'asc',
});
sorting.onSort(nextColumns);
}}>
Expand Down

0 comments on commit 568aed0

Please sign in to comment.