Skip to content

Commit

Permalink
fix: close #1988
Browse files Browse the repository at this point in the history
  • Loading branch information
Flcwl committed Nov 11, 2021
1 parent 7066cd3 commit 7823df7
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions components/table/HeaderTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,15 +165,11 @@ const HeaderTable = ({ rightFixedIndex }) => {
indeterminate={!isAllChecked && rowSelection.selectedRowKeys.length > 0}
onChange={(e) => {
if (rowSelection.onChange) {
const selectedItems = isAllChecked
? []
: flatTreeData(_.cloneDeep(data)).filter((data) => !disabledData.current.includes(data.key))

rowSelection.onChange(
selectedItems.map((item) => item.key),
selectedItems,
!isAllChecked
const targetItems = flatTreeData(_.cloneDeep(data)).filter(
(data) => !disabledData.current.includes(data.key)
)
const selectedIds = isAllChecked ? [] : targetItems.map((item) => item.key)
rowSelection.onChange(selectedIds, targetItems, !isAllChecked)
}
}}
/>
Expand Down

0 comments on commit 7823df7

Please sign in to comment.