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

feat: tabs with URL navigation #682

Merged

Conversation

marcpicaud
Copy link
Contributor

Fixes #570

Hey there,

First, thank you for django-unfold, I love it and I'm pretty sure I'm not alone.

Saving the activeTab state would benefit the users IMO:
Refreshing the page, sharing a link, navigating back and forth would be possible without losing the tab state.

In this PR:

  • Save the activeTab state in the URL when clicking tabs
  • Initialize the activeTab variable from the URL during a full reload

There's one problem with my current approach :
If any hash is detected in the URL, it will become the activeTab value. If the hash doesn't match with any tab href, there will be no tab displayed. Maybe to fix this we should have a naming convention for tabs ? Let me know what you think !

Cheers

@lukasvinclav lukasvinclav merged commit e8a8e98 into unfoldadmin:main Aug 19, 2024
6 checks passed
@lukasvinclav
Copy link
Contributor

Awesome work! Thanks for contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remember/show current active TAB (anchor tag link)
2 participants