Skip to content

Commit

Permalink
Merge pull request mbrn#1258 from sshanzel/bugfix/sortConfigConflict
Browse files Browse the repository at this point in the history
bugfix: disable defaultSorting when sorting = false
  • Loading branch information
mbrn authored Nov 8, 2019
2 parents 87d0bb7 + 52b0ae9 commit 90c28a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/material-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export default class MaterialTable extends React.Component {
setDataManagerFields(props, isInit) {
let defaultSortColumnIndex = -1;
let defaultSortDirection = '';
if (props) {
defaultSortColumnIndex = props.columns.findIndex(a => a.defaultSort);
if (props && props.options.sorting !== false) {
defaultSortColumnIndex = props.columns.findIndex(a => a.defaultSort && a.sorting !== false);
defaultSortDirection = defaultSortColumnIndex > -1 ? props.columns[defaultSortColumnIndex].defaultSort : '';
}

Expand Down

0 comments on commit 90c28a7

Please sign in to comment.