react-admin
react-admin copied to clipboard
String Ids with spaces are not supported by `TabbedForm`
What you were expecting:
I have an entity with string Id that has a space in it. When I navigate to Edit view with TabbedForm I expect to see working tabbed form and first tab is opened by default.
What happened instead: No tabs are rendered.
Steps to reproduce:
Related code:
I digged into the RA source code and found out, that TabbedFormView uses raw location.pathname to match with tab path. Obviously, spaces in URL are converted to %20 strings.
const hidden = syncWithLocation
? !matchPath(
`${resolvedPath.pathname}/${tabPath}`,
location.pathname
)
: tabValue !== index;
Environment
- React-admin version: 4.14.3
- React version: 18.2.0
Confirmed, thanks for the report. As this isn't a common use case, we won't work on fixing it ourselves, but we'll welcome any PR that fixes it.