mirror of
https://github.com/gosticks/react-table.git
synced 2026-06-29 01:20:02 +00:00
Handle edge cases in expandable hover states and event handlers
This commit is contained in:
15
src/index.js
15
src/index.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user