-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
Using conditional mui useDataGrid initial filters with syncWithLocation causes error after reloading page.
With syncWithLocation: false initial filters work well, with syncWithLocation: true not working.
Steps To Reproduce
- use mui DataGrid hook with initial filters like
{ operator: 'or', value: [ { operator: 'and', value: [ { field: 'isDismissed', operator: 'eq', value: true }, { field: 'participation.id', operator: 'nnull', value: '' }, ], }, { operator: 'and', value: [{ field: 'isDismissed', operator: 'eq', value: false }], }, ], },andsyncWithLocation: true - reload page
- we got toast with error: cannot read properties of undefined (reading map)
- in console we got filters from useDataGrid hook like:
[ { "operator": "or", "value": [ { "operator": "and", "value": [ { "[field]": "isDismissed", "[operator]": "eq", "[value]": "true" }, { "[field]": "participation.id", "[operator]": "nnull", "[value]": "" } ] }, { "operator": "and", "value": [ { "[field]": "isDismissed", "[operator]": "eq", "[value]": "false" } ] } ] } ]
we got [field] instead field, [operator] instead operator and [value] instead value.
Expected behavior
After reloading the page, we should deserialize the correct filters from the URL.
Packages
"@mui/material": "^6.1.7",
"@mui/x-data-grid": "^7.23.5",
"@mui/x-date-pickers": "^8.12.0",
"@refinedev/cli": "^2.16.48",
"@refinedev/core": "^5.0.0",
"@refinedev/devtools": "^2.0.1",
"@refinedev/kbar": "^2.0.0",
"@refinedev/mui": "^7.0.0",
"@refinedev/nestjsx-crud": "^6.0.0",
"@refinedev/react-hook-form": "^5.0.2",
"@refinedev/react-router": "^2.0.0",
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working