From 74fc3fd7106267e5a3f16b02359731ec07243537 Mon Sep 17 00:00:00 2001 From: Benjy Cui Date: Wed, 16 Dec 2015 10:31:08 +0800 Subject: [PATCH] fix: uncheck when all the data are disabled #682 --- components/table/index.jsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/components/table/index.jsx b/components/table/index.jsx index f8b45557fb..b7a481a186 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -306,17 +306,16 @@ let AntTable = React.createClass({ renderRowSelection() { let columns = this.props.columns.concat(); if (this.props.rowSelection) { - let data = this.getCurrentPageData(); + let data = this.getCurrentPageData().filter((item) => { + if (this.props.rowSelection.getCheckboxProps) { + return !this.props.rowSelection.getCheckboxProps(item).disabled; + } + return true; + }); let checked; if (!data.length) { checked = false; } else { - data = data.filter((item) => { - if (this.props.rowSelection.getCheckboxProps) { - return !this.props.rowSelection.getCheckboxProps(item).disabled; - } - return true; - }); checked = this.state.selectionDirty ? data.every((item, i) => this.state.selectedRowKeys.indexOf(this.getRecordKey(item, i)) >= 0)