Fix combining the new visible columns with all (#1977)

This commit is contained in:
Roman Komarov 2020-03-18 22:36:58 +01:00 committed by GitHub
parent 5e875aa6e2
commit 689db0755f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,11 +237,11 @@ export const useTable = (props, ...plugins) => {
] ]
) )
// Combine new visible columns with all columns (dedupe prefers later columns) // Combine new visible columns with all columns
allColumns = React.useMemo(() => { allColumns = React.useMemo(() => {
const columns = [...allColumns] const columns = [...visibleColumns]
visibleColumns.forEach(column => { allColumns.forEach(column => {
if (!columns.find(d => d.id === column.id)) { if (!columns.find(d => d.id === column.id)) {
columns.push(column) columns.push(column)
} }