react admin:使用SelectInput进行筛选会显示错误的值



我的react-admin应用程序中的以下筛选器会导致列表显示带有status === "active"的记录和带有status === "inactive"的记录。它应该只显示具有status === "active"的记录。

<SelectInput 
alwaysOn 
source="status" 
choices={[
{ id: "lead", name: "Lead" },
{ id: "active", name: "Aktiv" },
{ id: "inactive", name: "Inaktiv" },
]} 
/>

它似乎包括具有CCD_ 5的记录;不活动";包含子串";"活动";。

我能做点什么吗?我的DataProvider配置错误了吗?我正在使用react-admin-firebase

react admin firebase在搜索字符串时总是进行模糊搜索:

const isStringSearch = typeof searchValue === 'string';
if (isStringSearch) {
return searchThis
.toString()
.toLowerCase()
.includes(searchValue.toLowerCase());
}

一种解决方案是使用status的数字:

<SelectInput 
alwaysOn 
source="status" 
choices={[
{ id: 1, name: "Lead" },
{ id: 2, name: "Aktiv" },
{ id: 3, name: "Inaktiv" },
]} 
/>

另一个解决方案是允许懒惰加载直接针对你的firebase进行搜索。

相关内容

最新更新