gregnb / gregnb/mui-datatables

Bug: when using the search widget the selected row is always the 1st on the sorted column

Open
#1,545 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.7k
Forks
906
PR merge metrics
No merged PRs in 30d

Description

I have a table which can be sorted by multiple columns. When you click on a row, you go to a page associated with that row.

The problem happens when clicking the search widget, and finding a row. Clicking on it takes you to the page associated with the top row - and not the row you searched.

**Steps to reproduce:**

1. Go to https://deepdao.io, and click on the search widget. Search for any DAO (row in the table), then click on the row: notice that regardless of which DAO was found by the search, it's going to the top DAO by the default sort, which is AUM.

2. Now change the sort (just click on any of the column headers) and search again: click on the selected row would send you to the DAO at the top of the current, new sort.

I'm using a custom sort on the table options to make sure that the selected row is always the one that relates to the current sort. But this doesn't help with the search widget.

**Version:** 2.6.4 and it cannot be changed at this point without more work than what I can prioritize.

Is there a solution? Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the issue at deepdao.io with the search widget, then inspect the table's search and row-selection behavior. Verify the selected search result is retained after sorting and that clicking it opens the associated DAO rather than the first row in the current sort.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.