Handle edge cases in expandable hover states and event handlers

This commit is contained in:
Tanner Linsley
2017-05-10 15:48:29 -06:00
parent 7c7e688811
commit cfdc688501

View File

@@ -530,13 +530,22 @@ export default class ReactTable extends Methods(Lifecycle(Component)) {
))
const ResolvedPivotComponent = column.Pivot || DefaultResolvedPivotComponent
// Is this column pivoted?
// Is this cell expandable?
if (cellInfo.pivoted || cellInfo.expander) {
// Make it expandable
cellInfo.expandable = cellInfo.subRows
// Make it expandable by defualt
cellInfo.expandable = true
interactionProps = {
onClick: onExpanderClick
}
// If pivoted, has no subRows, and does not have a subComponent, do not make expandable
if (cellInfo.pivoted) {
if (!cellInfo.subRows) {
if (!SubComponent) {
cellInfo.expandable = false
interactionProps = {}
}
}
}
}
if (cellInfo.pivoted) {