Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] el-table does not retain currently selected row when sorting the table. #11021

Closed
ghost opened this issue May 4, 2018 · 0 comments

Comments

@ghost
Copy link

ghost commented May 4, 2018

Element UI version

2.3.7

OS/Browsers version

Mac OS High Sierra 10.13.4 (17E199) / Chrome 66.0.3359.139 (Official Build) (64-bit)

Vue version

2.5.16

Reproduction Link

https://jsfiddle.net/dvprasath/fqbc2xcr/51/

Steps to reproduce

  • Select the row with the name 'obama'.
  • Sort the table by clicking on column 'Name'
  • Notice that the selected row is not 'obama'

What is Expected?

currently selected row should be retained even when the table is sorted.

What is actually happening?

Selections are applied based on the index of the tableData which works fine as long as the table isn't sorted. As soon as the table is sorted, the selection is applied to the wrong row because the previously selected row's index is not recomputed based on the sorted tableData.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants