Skip to content

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

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

Open
gensmusic opened this issue Mar 21, 2025 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@gensmusic
Copy link

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 gensmusic added the bug Something isn't working label Mar 21, 2025
@SauravGupta123
Copy link

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

@gensmusic
Copy link
Author

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

@alicanerdurmaz
Copy link
Member

Hello @gensmusic, Thanks for the issue.

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

@kennyma
Copy link

kennyma commented Mar 26, 2025

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

@stale stale bot added the wontfix This will not be worked on label May 26, 2025
@alicanerdurmaz alicanerdurmaz removed the wontfix This will not be worked on label May 26, 2025
@refinedev refinedev deleted a comment from stale bot May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants