我的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进行搜索。