Skip to content
This repository was archived by the owner on Dec 11, 2019. It is now read-only.

Commit 809b61d

Browse files
committed
Fix global table indexing
fix #4741 Auditors: @bsclifton Test Plan: 1. go to about:history 2. sort the table 3. multi select entries 4. right click on them 5. perform any actions in context menu 6. the action tagets should be correct
1 parent 689b48b commit 809b61d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/components/sortableTable.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,11 @@ class SortableTable extends ImmutableComponent {
8383
entry.className = entry.className.replace(' selected', '')
8484
const tableID = entry.id
8585
const index = entry.rowIndex - 1
86+
const globalIndex = parseInt(entry.title)
8687
const handlerInput = this.props.totalRowObjects
87-
? (typeof this.props.totalRowObjects[parseInt(tableID)][index].toJS === 'function'
88-
? this.props.totalRowObjects[parseInt(tableID)][index].toJS()
89-
: this.props.totalRowObjects[parseInt(tableID)][index])
88+
? (typeof this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS === 'function'
89+
? this.props.totalRowObjects[parseInt(tableID)][globalIndex].toJS()
90+
: this.props.totalRowObjects[parseInt(tableID)][globalIndex])
9091
: (this.props.rowObjects.size > 0 || this.props.rowObjects.length > 0)
9192
? (typeof this.props.rowObjects.toJS === 'function'
9293
? this.props.rowObjects.get(index).toJS()
@@ -212,6 +213,7 @@ class SortableTable extends ImmutableComponent {
212213
? <tr {...rowAttributes}
213214
data-context-menu-disable={rowAttributes.onContextMenu ? true : undefined}
214215
id={this.props.tableID}
216+
title={i}
215217
className={
216218
(this.hasRowClassNames
217219
? this.props.rowClassNames[i] + ' ' + rowAttributes.className

0 commit comments

Comments
 (0)