refine icon indicating copy to clipboard operation
refine copied to clipboard

[BUG] RangePicker in Table Search Form: URL restoration causes incorrect value type

Open gensmusic opened this issue 8 months ago • 4 comments

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.

Image Image

Steps To Reproduce

  1. create example talbe antd table filter by running npm create refine-app@latest -- --example table-antd-table-filter
  2. start the project yarn dev
  3. In Filters, pick any date in Created At, then click.
  4. 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.
Image Image

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 avatar Mar 21 '25 05:03 gensmusic

@gensmusic can you assign this issue to me. I have found out where the issue lies

SauravGupta123 avatar Mar 21 '25 18:03 SauravGupta123

@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.

gensmusic avatar Mar 22 '25 01:03 gensmusic

Hello @gensmusic, Thanks for the issue.

I assigned to you @SauravGupta123, thanks for improving Refine!

alicanerdurmaz avatar Mar 24 '25 07:03 alicanerdurmaz

Just ran into this issue. Hi @SauravGupta123, do you have an ETA on a fix or suggestion to work around this?

kennyma avatar Mar 26 '25 23:03 kennyma

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.

stale[bot] avatar Jul 25 '25 07:07 stale[bot]