refine
refine copied to clipboard
[BUG] RangePicker in Table Search Form: URL restoration causes incorrect value type
Describe the bug
When using refine's Table component combined with a search form that includes a RangePicker, with URL synchronization enabled (syncWithLocation), an issue arises. When the URL (which contains the search query parameters) is pasted into the browser, the initial value for the RangePicker is restored as a single string instead of an array. Then you will get blank page and an error in console.
It's very easy to reproduce as follows.
Steps To Reproduce
- create example talbe antd table filter by running
npm create refine-app@latest -- --example table-antd-table-filter - start the project
yarn dev - In Filters, pick any date in
Created At, then click. - copy the url in the browser, then paste it and open(or just click Refresh button), you will get a blank page and an error in console.
Expected behavior
page should be open and Created At filter is set ok.
Packages
"dependencies": { "@ant-design/icons": "^5.5.1", "@refinedev/antd": "^5.45.3", "@refinedev/cli": "^2.16.44", "@refinedev/core": "^4.57.7", "@refinedev/react-router": "^1.0.1", "@refinedev/simple-rest": "^5.0.10", "@uiw/react-md-editor": "^3.19.5", "antd": "^5.17.0", "dayjs": "^1.10.7", "react": "^18.0.0", "react-dom": "^18.0.0", "react-router": "^7.0.2" }, "devDependencies": { "@types/node": "^18.16.2", "@types/react": "^18.0.0", "@types/react-dom": "^18.0.0", "@vitejs/plugin-react": "^4.2.1", "typescript": "^5.4.2", "vite": "^5.1.6" } }
Additional Context
No response
@gensmusic can you assign this issue to me. I have found out where the issue lies
@gensmusic can you assign this issue to me. I have found out where the issue lies
I really want to do that, but I don't have permission to assign this issue to you.
Hello @gensmusic, Thanks for the issue.
I assigned to you @SauravGupta123, thanks for improving Refine!
Just ran into this issue. Hi @SauravGupta123, do you have an ETA on a fix or suggestion to work around this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.