Skip to content

Commit

Permalink
fix(data-table): when the filterOptions value is 0, the filter will n…
Browse files Browse the repository at this point in the history
…ot take effect (#2395)

Co-authored-by: 07akioni <[email protected]>
  • Loading branch information
XieZongChen and 07akioni authored Feb 15, 2022
1 parent cae50be commit d3fc380
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fix `n-switch` can't use keyboard operation when checked value is customized.
- Fix `n-data-table`'s fixed column is covered by scroll content when placed inside popover.
- Fix `n-data-table` when the `filterOptions` value is 0, the filter will not take effect.
- Fix `n-data-table` cannot click selection checkbox if the selection column is a column's child.

### Feats
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- 修复 `n-switch` 在自定义选中值的时候无法使用键盘操作
- 修复 `n-data-table` 放在 popover 内使用固定列滚动内容覆盖
- 修复 `n-data-table``filterOptions` 值为 0 时过滤不生效
- 修复 `n-data-table` 当 selection column 为某个 column 的子 column 时无法点击全选复选框

### Feats
Expand Down
2 changes: 1 addition & 1 deletion src/data-table/src/use-table-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export function useTableData (
columnsWithControlledFilter.forEach((column) => {
if (column.type === 'selection' || column.type === 'expand') return
controlledFilterState[column.key] =
column.filterOptionValues || column.filterOptionValue || null
column.filterOptionValues ?? column.filterOptionValue ?? null
})
const activeFilters = Object.assign(
createShallowClonedObject(uncontrolledFilterStateRef.value),
Expand Down

0 comments on commit d3fc380

Please sign in to comment.