From 70827eecd6f6cb791d8b14b1a53a5413d1131400 Mon Sep 17 00:00:00 2001 From: AllenFang Date: Mon, 19 Aug 2019 21:28:22 +0800 Subject: [PATCH] fix #1061 --- packages/react-bootstrap-table2/src/contexts/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/react-bootstrap-table2/src/contexts/index.js b/packages/react-bootstrap-table2/src/contexts/index.js index 1df8d6c..1793dfb 100644 --- a/packages/react-bootstrap-table2/src/contexts/index.js +++ b/packages/react-bootstrap-table2/src/contexts/index.js @@ -91,6 +91,13 @@ const withContext = Base => this.PaginationContext = nextProps.pagination.createContext( this.isRemotePagination, this.handleRemotePageChange); } + if (!nextProps.cellEdit && this.props.cellEdit) { + this.CellEditContext = null; + } + if (nextProps.cellEdit && !this.props.cellEdit) { + this.CellEditContext = nextProps.cellEdit.createContext( + _, dataOperator, this.isRemoteCellEdit, this.handleRemoteCellChange); + } } renderBase() {