Skip to content
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

Inputs are not displayed when using TabbedForm #9942

Closed
armandosg opened this issue Jun 20, 2024 · 2 comments · Fixed by #10021
Closed

Inputs are not displayed when using TabbedForm #9942

armandosg opened this issue Jun 20, 2024 · 2 comments · Fixed by #10021
Labels

Comments

@armandosg
Copy link

What you were expecting:

When navigating to an edit route that uses TabbedForm the inputs should be displayed.

What happened instead:

When navigating to an edit route that uses TabbedForm the inputs are not displayed.

Steps to reproduce:

  1. Clone the sample application. https://github.com/armandosg/react-admin-v5
  2. Run the server
  3. Navigate to the "Resources" list
  4. Click on the first item
  5. Check that the input are not displayed
  6. Click on any tab link
  7. The inputs are displayed now

Related code:

https://github.com/armandosg/react-admin-v5

Other information:

I'm seeing that this only happens when the id of the resource contains special characters.

Environment

  • React-admin version: 5.0.1
  • Last version that did not exhibit the issue (if applicable): 4.x.x
  • React version: 18
  • Browser: Chrome
  • Stack trace (in case of a JS error):
@fzaninotto
Copy link
Member

Confirmed, thanks.

Tested on https://codesandbox.io/p/devbox/github/armandosg/react-admin-v5/tree/main, it seems the bug only occurs on the first resource, the one with a colon in its id ("1:prod:resource1"). So it seems to be that the TabbedForm routing is too strict on the id it accepts.

@fzaninotto fzaninotto added the bug label Jun 20, 2024
@djhi
Copy link
Contributor

djhi commented Jul 19, 2024

This issue has been introduced by remix-run/react-router#11199 released in react-router@6.22.1.

The location returned by useLocation is "/resource/1:prod:resource1/" while useResolvedPath now returns "/resource/1%3Aprod%3Aresource1"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants