Skip to content
New issue

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

Filters applied with JavaScript property paths do not retain state #3338

Closed
scottlowe opened this issue Jun 14, 2019 · 1 comment
Closed

Comments

@scottlowe
Copy link

scottlowe commented Jun 14, 2019

What you were expecting:

  1. Apply 2 filters with source username and company.street to a Users list view
  2. Navigate away to a list view of Posts
  3. Navigate back to Users list view
  4. Expect both filters username and company.street to still be applied to Users list

What happened instead:
When returning to the Users list view, only filter username is still applied. The filter company.street has disappeared.

Note: The filter that has disappeared has a compound property path as its source.

Steps to reproduce:
Steps to reproduce are identical to the "expected" steps above. However, here is an additional screen capture to better illustrate the bug:

ScreenRecording20190614at1

Related code:

const UserFilter = (props) => (
    <Filter {...props}>
        <TextInput source="username" />
        {*/ Here's the problem */}
        <TextInput source="company.name" />  
    </Filter>
);

export const UserList = props => (
    <List {...props} filters={<UserFilter />}>
        <Datagrid rowClick="edit">
            <TextField source="id" />
            <TextField source="username" />
            <TextField source="company.name" />
        </Datagrid>
    </List>
);

Other information:

Environment

  • React-admin version: 2.9.2
  • React version: 16.8.6
  • Browser:
    • Firefox 67.0
    • Chrome 75.0.3770.90
    • Chromium 72.0.3626.81
    • Safari 12.1.1

This issue possibly relates to #2657

@scottlowe
Copy link
Author

Ach. I have just found that a fix has already been committed for this bug here: #3274

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant