gregnb / gregnb/mui-datatables

customSort function using phantom index

Open
#924 1 comment 0 reactions 0 assignees View on GitHub
needs verification
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

Our app has a regular data update and page refresh. We cannot maintain the UI when a user is interacting with the table sort during the page pull. There is a default sort that works fine on load, but any attempts to sort after first calls `customSort` on the correct index but immediately fires a second sort on the last index.

## Expected Behavior
To only call `customSort` on the index of the desired column, followed only by the `onColumnSortChange` for that index.

## Current Behavior
The `customSort` runs on the desired index
`onColumnSortChange` runs on the desired index
mysteriously `customSort` then fires on the last index in the table
`onColumnSortChange` does not fire after the mysterious `customSort`

## Steps to Reproduce (for bugs)

https://codesandbox.io/s/muidatatables-customize-columns-tr4t8

1. Open console
2. Attempt to sort table
3. Investigate

## Your Environment
The sandbox mirrors our versions.
"@material-ui/core": "4.4.2",
"@material-ui/icons": "1.1.0",
"lodash": "4.17.15",
"mui-datatables": "2.11.0",
"react": "16.9.0",
"react-dom": "16.8.0"

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.