From 4cf6e65abc7777428d4b7d357b07b3bf3a8698ae Mon Sep 17 00:00:00 2001 From: AllenFang Date: Sat, 22 Jun 2019 13:50:50 +0800 Subject: [PATCH] fix #979 --- packages/react-bootstrap-table2/src/row/aggregate-row.js | 4 ++-- packages/react-bootstrap-table2/src/row/should-updater.js | 5 +++++ packages/react-bootstrap-table2/src/row/simple-row.js | 3 +-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/packages/react-bootstrap-table2/src/row/aggregate-row.js b/packages/react-bootstrap-table2/src/row/aggregate-row.js index 3a151db..f0d9187 100644 --- a/packages/react-bootstrap-table2/src/row/aggregate-row.js +++ b/packages/react-bootstrap-table2/src/row/aggregate-row.js @@ -37,10 +37,10 @@ export default class RowAggregator extends shouldUpdater(eventDelegater(React.Co this.props.selectable !== nextProps.selectable || this.shouldUpdatedBySelfProps(nextProps) ) { - this.shouldUpdateRowContent = this.shouldUpdateChild(nextProps); + this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps); return true; } - this.shouldUpdateRowContent = this.shouldUpdateChild(nextProps); + this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps); return this.shouldUpdateRowContent; } diff --git a/packages/react-bootstrap-table2/src/row/should-updater.js b/packages/react-bootstrap-table2/src/row/should-updater.js index c61ae5e..fb1f1be 100644 --- a/packages/react-bootstrap-table2/src/row/should-updater.js +++ b/packages/react-bootstrap-table2/src/row/should-updater.js @@ -48,4 +48,9 @@ export default ExtendBase => return this.shouldUpdateByCellEditing(nextProps) || this.shouldUpdatedByNormalProps(nextProps); } + + shouldRowContentUpdate(nextProps) { + return this.shouldUpdateChild(nextProps) || + this.shouldUpdateByColumnsForSimpleCheck(nextProps); + } }; diff --git a/packages/react-bootstrap-table2/src/row/simple-row.js b/packages/react-bootstrap-table2/src/row/simple-row.js index 96ca92f..0ad992f 100644 --- a/packages/react-bootstrap-table2/src/row/simple-row.js +++ b/packages/react-bootstrap-table2/src/row/simple-row.js @@ -15,8 +15,7 @@ class SimpleRow extends shouldUpdater(eventDelegater(Component)) { shouldComponentUpdate(nextProps) { this.shouldUpdateRowContent = false; - this.shouldUpdateRowContent = - this.shouldUpdateChild(nextProps) || this.shouldUpdateByColumnsForSimpleCheck(nextProps); + this.shouldUpdateRowContent = this.shouldRowContentUpdate(nextProps); if (this.shouldUpdateRowContent) return true; return this.shouldUpdatedBySelfProps(nextProps);