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: custom table filterDropdown #28850

Merged
merged 3 commits into from
Jan 15, 2021

Conversation

Meowu
Copy link
Contributor

@Meowu Meowu commented Jan 13, 2021

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

close #28801

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English fix that invalid params passed to onChange event if define custom filterDropdown and nested filters
🇨🇳 Chinese 修复 Table 自定义过滤器时 onChange 参数 filters 被错误转换,以及多级过滤器时 onChange 的 filters 参数为空数组的问题

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@ant-design-bot
Copy link
Contributor

ant-design-bot commented Jan 13, 2021

@codesandbox-ci
Copy link

codesandbox-ci bot commented Jan 13, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2295bce:

Sandbox Source
antd reproduction template Configuration

@github-actions
Copy link
Contributor

github-actions bot commented Jan 13, 2021

Size Change: -370 B (0%)

Total Size: 788 kB

Filename Size Change
./dist/antd-with-locales.min.js 312 kB -224 B (0%)
./dist/antd.compact.min.css 66.9 kB +26 B (0%)
./dist/antd.dark.min.css 68.2 kB +31 B (0%)
./dist/antd.min.css 66.9 kB +26 B (0%)
./dist/antd.min.js 274 kB -229 B (0%)

compressed-size-action

@Meowu Meowu changed the title [WIP]fix: custom table filterDropdown fix: custom table filterDropdown Jan 15, 2021
@afc163
Copy link
Member

afc163 commented Jan 15, 2021

图片

@afc163
Copy link
Member

afc163 commented Jan 15, 2021

修复表格自定义过滤器和多级过滤器时,onChange 事件接受的过滤参数错误的问题

修复 Table 自定义过滤器和多级过滤器时 onChange 参数为空数组的问题。

这样描述是不是准确?

const keys = flattenKeys(filters);
keys?.forEach(originKey => {
if (filteredKeys.includes(String(originKey))) {
originKeys.push(originKey);
}
});
Copy link
Member

Choose a reason for hiding this comment

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

originKeys = keys.filter(originKey => filteredKeys.includes(String(originKey)));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nice 我改一下。

@Meowu
Copy link
Contributor Author

Meowu commented Jan 15, 2021

修复表格自定义过滤器和多级过滤器时,onChange 事件接受的过滤参数错误的问题

修复 Table 自定义过滤器和多级过滤器时 onChange 参数为空数组的问题。

这样描述是不是准确?

描述为错误,是因为在自定义组件时做了不必要的转换,在多级过滤器时为空数组。

我更新了 changelog 的描述。

@afc163 afc163 merged commit 0f0dc15 into ant-design:master Jan 15, 2021
@ycjcl868 ycjcl868 mentioned this pull request Jan 18, 2021
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.

4.10.0 table多级筛选无法筛选
3 participants