benwinding / react-admin-firebase

A firebase data provider for the react-admin framework
https://benwinding.github.io/react-admin-firebase/
MIT License
460 stars 181 forks source link

List filters and sort cannot work together #204

Open OlivierVoyer opened 3 years ago

OlivierVoyer commented 3 years ago
const UserFilter = (props: any) => (
  <Filter {...props}>
    <TextInput source="email" alwaysOn />
  </Filter>
);

export const UserList = (props: any) => {
  return (
    <List
      {...props}
      filters={<UserFilter />}
      sort={{ field: "email", order: "ASC" }}
    >
...

What I try is to have my list sorted by default by email values and then having a search filter on that same attribute.

As soon as I type something in the search field, I have the following error:

FirebaseError: [code=invalid-argument]: Order by clause cannot contain a field with an equality filter email

Note that the filter or sort are correctly working when used alone but the error appears as soon as I have both in my List component.

Regards

bsampp commented 1 year ago

did you find any solution?

OlivierVoyer commented 1 year ago

Unfortunately I didn't and gave up