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

Basename Not Included in href for Links in Left Navigation #4556

Open
SilenceLeo opened this issue Dec 24, 2024 · 2 comments
Open

Basename Not Included in href for Links in Left Navigation #4556

SilenceLeo opened this issue Dec 24, 2024 · 2 comments
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer

Comments

@SilenceLeo
Copy link

SilenceLeo commented Dec 24, 2024

Steps to reproduce

When a basename is added to React Router,the href in the left-side navigation does not include the basename.
While everything works fine during regular navigation, the path is incorrect when opening links in a new window or tab.
e.g., right-click -> Open link in new tab

@toolpad/[email protected]

Current behavior

No response

Expected behavior

No response

Context

No response

Your environment

No response

Search keywords: navigation, routing, link, basename

@SilenceLeo SilenceLeo added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Dec 24, 2024
@apedroferreira
Copy link
Member

apedroferreira commented Dec 24, 2024

Hi, could you please share a reproduction / CodeSandbox or the specific configuration you're using for React Router and the navigation passed to AppProvider?

I wonder if just including the basename in the segments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.

@Janpot
Copy link
Member

Janpot commented Dec 24, 2024

I wonder if just including the basename in the segments for navigation items would be enough, but if that solution isn't elegant enough we can try to come up with something better.

I believe this will need to be part of the router adapter. the DashboardLayout should not need to know about the basepath.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for maintainer These issues haven't been looked at yet by a maintainer
Projects
None yet
Development

No branches or pull requests

3 participants