React Admin removes filter box after "no results" list

Viewed 520

I'm working with React Admin and I have a list with a box to filter by ID.

I filter by ID 0000 (for example), it returns "theres not data yet", but it removes my filter box and I can't restart filters or change it.

I would like to avoid React Admin to set this "Empty" view, and I have read about param "empty", I pass empty param to the List component, but I get nothing different.

              <List
              {...props}
              actions={<ListActions hasCreate={false} maxResults={MAX_LIMIT_EXPORT} />}
              filters={<Filter translate={translate} permissions={permissions} />}
              pagination={<Pagination />}
              bulkActionButtons={false}
              empty={<div>No results found</div>}
            >

I just want to handle what happends after receive an "empty" response, to keep my filters visible.

2 Answers

The ReactAdmin documentation about List#empty prop says it all:

When there is no result, and there is no active filter, and the resource has a create page, react-admin displays a special page inviting the user to create the first record.

I'm struggle with the same exact issue. I wonder if you have a solution now?

Try adding a limit prop to your pagination component. (React-Admin pagination docs)

<List {...props}
  pagination={<Pagination limit={<div>No Results Found</div>} />}
>
Related