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

Commit

Permalink
Merge pull request #5237 from bsclifton/master
Browse files Browse the repository at this point in the history
Properly handle a null row / zero rows
  • Loading branch information
jkup authored Oct 28, 2016
2 parents 09e858c + e882655 commit e26ffd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions js/components/sortableTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,15 @@ class SortableTable extends React.Component {
? this.getRowAttributes(row, i)
: null

const classes = [rowAttributes.className]
const classes = []
if (rowAttributes) classes.push(rowAttributes.className)
if (this.hasRowClassNames) classes.push(this.props.rowClassNames[i])
if (this.stateOwner.state.selection.includes(this.getGlobalIndex(i))) classes.push('selected')
if (this.sortingDisabled) classes.push('no-sort')

return row.length
? <tr {...rowAttributes}
data-context-menu-disable={rowAttributes.onContextMenu ? true : undefined}
data-context-menu-disable={rowAttributes && rowAttributes.onContextMenu ? true : undefined}
data-table-id={this.tableID}
data-row-index={i}
className={classes.join(' ')}>{entry}</tr>
Expand Down

0 comments on commit e26ffd8

Please sign in to comment.