react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

String Ids with spaces are not supported by `TabbedForm`

Open mikhail-fedosenko opened this issue 1 year ago • 1 comments

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;
Screenshot 2023-12-26 at 12 27 31

Environment

  • React-admin version: 4.14.3
  • React version: 18.2.0

mikhail-fedosenko avatar Dec 26 '23 09:12 mikhail-fedosenko

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.

fzaninotto avatar Jan 03 '24 13:01 fzaninotto