InvenTree icon indicating copy to clipboard operation
InvenTree copied to clipboard

Platform Header Tabs vanish on refresh

Open CodingPupper3033 opened this issue 1 year ago • 0 comments

Discussed in https://github.com/inventree/InvenTree/discussions/6470

Originally posted by CodingPupper3033 February 12, 2024 Hello! I've been trying to wrap my head around the new ui's source code, and I can't figure something out.

In Headers.tsx, function NavTabs, we have the variable tabValue to tell the tabs which one it's on. It uses parameters, so I looked at the router.tsx file, and I don't see any :tabValue, so how does the value get set?

Also, I think there's a minor bug based on this where if you use the browser bar to navigate to a page and not a tab, the header (and just the header) will think you're on the default home page. It's not a critical bug, but it exists.

Issue: The header tabs value is set to be a react-router dom parameter; however, the parameter is not set in the router. This means that on a refresh or navigating to the URL directly, the tab will be incorrectly labeled as the Home tab (default tab).

I still can't figure out how to assign labels and the issue to myself, but I have a fix. I'll try uploading it!

CodingPupper3033 avatar Feb 12 '24 14:02 CodingPupper3033