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
TabbedForm w/ syncWithLocation shows nothing if resource id contains URL-encoded chars #8380
Comments
Reproduced, thanks! |
I had another look at this today. I don't think this is an issue with There's also (other, yet similar) issues reported upstream: remix-run/react-router#9580 |
@slax57 after react-router upstream fixed the issue I've had another look at this issue and noticed that I've created two more stackblitz sandboxes. A very basic one that just uses plain It should output:
i.e. mismatching URLs.
... interestingly the PR is merged for quite a while. Therefore I created another sandbox trying it out with ... which outputs matching pathnames, i.e. it works. Please note, that I'm using Or to put it differently: the types of Also there's a deprecated hint to the Please let me know in which direction you tend to go. PS: To me this is not ultra important, I've justed disabled |
Thanks for your feedback. This is a rare use case, it's fixable in user land with |
What you were expecting:
TabbedForm
renders one visible tab.What happened instead:
No tab is visible.
Steps to reproduce:
Use
TabbedForm
on a resource with string-type ids + have an id that contains a URL-encoded char, e.g. "space" which is encoded as "%20"Related code:
https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/form/TabbedFormView.tsx#L85
resolvedPath.pathname
is like/posts/better no spaces here
location.pathname
is like/posts/better%20no%20spaces%20here
... hence no match. For no route. And therefore all tabs hidden.
StackBlitz
https://stackblitz.com/edit/github-c52e17
click the (first) Post named "Post to break stuff"
Other information:
Environment
The text was updated successfully, but these errors were encountered: