earthquake-eventpages icon indicating copy to clipboard operation
earthquake-eventpages copied to clipboard

Highlight proper tab on initial click

Open emartinez-usgs opened this issue 6 years ago • 2 comments

  • Load origin details page
  • Click "Origin" link in left navigation

Note the "Magnitude" tab is highlighting as selected now.

Check other pages with tabs as well.

emartinez-usgs avatar Oct 04 '18 16:10 emartinez-usgs

I'm not sure if this will help solve the issue, but I also noticed that if you select any tab other than the first tab in the tab list. Then, if you click the link that is currently highlighted in the side navigation, the page will be updated to show the original content, but the incorrect tab will still be selected.

To recreate:

  • click "origin" in the side navigation
  • click on the "magnitude" tab
  • click "origin" in the side navigation

Now you should see the origin details table, but the magnitude tab will still be selected. It's basically the same behavior, it just makes a little more sense to me. It feels like the tab list is getting confused by the fallback route (the catch all), and just assigning the selected status to the last tab.

ehunter-usgs avatar Oct 10 '18 21:10 ehunter-usgs

I could not come up with a solution to this problem. It is possible to stop the first problem reported by eric. You can change the side navigation router link to be the exact link to the first tab and not rely on the default route. However, then this means that the side navigation item will not be highlighted once the selected tab is changed.

ehunter-usgs avatar Oct 11 '18 16:10 ehunter-usgs