We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
filtered
https://github.com/ant-design/ant-design/blob/HEAD/components/table/hooks/useFilter/index.tsx
搜索:if (collectedStates.every(({ filteredKeys }) => filteredKeys === undefined)) {
if (collectedStates.every(({ filteredKeys }) => filteredKeys === undefined)) {
if (collectedStates.every(({ filteredKeys, forceFiltered }) => (filteredKeys === undefined && forceFiltered === undefined))) {
Table 只通过 filteredKeys 判断是否受控,而不考虑 forceFiltered 字段,请问是有意为之吗?
The text was updated successfully, but these errors were encountered:
你遇到什么问题了么?
Sorry, something went wrong.
场景是:自行实现了一个筛选组件,该组件中的筛选状态能反映到表格中。即:通过直接设置 filtered 属性控制表格的「已筛选」状态
示例代码:
const [isFiltered, setIsFiltered] = useState(false); const columns = [ { filtered: isFiltered, }, ];
但由于 issue 中的判断逻辑,我还必须额外设置 filteredValue,才能达到目的
const columns = [ { filtered: isFiltered, filteredValue: [], }, ];
比较好奇为什么不能仅仅设置 filtered,是出于什么设计的权衡吗
场景是:自行实现了一个筛选组件,该组件中的筛选状态能反映到表格中。即:通过直接设置 filtered 属性控制表格的「已筛选」状态 示例代码: const [isFiltered, setIsFiltered] = useState(false); const columns = [ { filtered: isFiltered, }, ]; 但由于 issue 中的判断逻辑,我还必须额外设置 filteredValue,才能达到目的 const columns = [ { filtered: isFiltered, filteredValue: [], }, ]; 比较好奇为什么不能仅仅设置 filtered,是出于什么设计的权衡吗 你简直救了我的命啊,我就是没写那个filteredValue: [], 筛选active 死活多出现不了。
比较好奇为什么不能仅仅设置 filtered,是出于什么设计的权衡吗 你简直救了我的命啊,我就是没写那个filteredValue: [], 筛选active 死活多出现不了。
Successfully merging a pull request may close this issue.
Reproduction link
https://github.com/ant-design/ant-design/blob/HEAD/components/table/hooks/useFilter/index.tsx
Steps to reproduce
搜索:
if (collectedStates.every(({ filteredKeys }) => filteredKeys === undefined)) {
What is expected?
if (collectedStates.every(({ filteredKeys, forceFiltered }) => (filteredKeys === undefined && forceFiltered === undefined))) {
What is actually happening?
if (collectedStates.every(({ filteredKeys }) => filteredKeys === undefined)) {
Table 只通过 filteredKeys 判断是否受控,而不考虑 forceFiltered 字段,请问是有意为之吗?
The text was updated successfully, but these errors were encountered: