Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(data-table): The filter will not take effect when the filterOptions value is 0 #2395

Merged
merged 2 commits into from
Feb 15, 2022
Merged

fix(data-table): The filter will not take effect when the filterOptions value is 0 #2395

merged 2 commits into from
Feb 15, 2022

Conversation

XieZongChen
Copy link
Collaborator

close #2392

@vercel
Copy link

vercel bot commented Feb 14, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tusimple/naive-ui/Bo9Ge8Je7DqQdtcQfZHNYhxFdErv
✅ Preview: https://naive-ui-git-fork-amadeus711-fix-ndatatable-fil-467329-tusimple.vercel.app

@codecov
Copy link

codecov bot commented Feb 14, 2022

Codecov Report

Merging #2395 (0df8dd6) into main (dd31e30) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head 0df8dd6 differs from pull request most recent head 5139f04. Consider uploading reports for the commit 5139f04 to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2395      +/-   ##
==========================================
- Coverage   63.76%   63.74%   -0.02%     
==========================================
  Files         944      944              
  Lines       19015    19011       -4     
  Branches     4746     4745       -1     
==========================================
- Hits        12124    12119       -5     
  Misses       5846     5846              
- Partials     1045     1046       +1     
Impacted Files Coverage Δ
src/data-table/src/use-table-data.ts 64.15% <0.00%> (-0.88%) ⬇️
src/number-animation/src/NumberAnimation.tsx 86.36% <0.00%> (-2.28%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cae50be...5139f04. Read the comment docs.

@@ -85,7 +85,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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其实还是有点问题,得用 undefined 来拦截,null 应该是受控的,就刻意为空

@07akioni 07akioni merged commit d3fc380 into tusen-ai:main Feb 15, 2022
jaulz pushed a commit to jaulz/naive-ui that referenced this pull request Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

数据表格过滤器选项值为数值0时,过滤条件不生效。
2 participants