Skip to content

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

@ghost

Description

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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions