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

Hyperlink to tab #34

Closed
markbattistella opened this issue Nov 28, 2020 · 5 comments
Closed

Hyperlink to tab #34

markbattistella opened this issue Nov 28, 2020 · 5 comments
Labels
enhancement New feature or request

Comments

@markbattistella
Copy link

Maybe I've missed it somewhere, but it would be cool to be able to link to a tab section and to an active tab.

Having a link to http://localhost:3000/#/newPage?id=windows

And it jumping to the newPage document, and activating the windows tab

@jhildenbiddle jhildenbiddle added the enhancement New feature or request label Dec 16, 2020
@jhildenbiddle
Copy link
Owner

jhildenbiddle commented Dec 16, 2020

HI @markbattistella.

Should be easy enough to add, but I have some concerns about treating tabs as anchor links. Auto-scrolling a tab set to the top of the viewport means site visitors will arrive on a page without context for the tab content they are viewing.

Is the goal to allow navigating to directly to tab sets from other sites or to jump directly to tab sets from links in your own site docs?

@markbattistella
Copy link
Author

I think it may have been a bug when I was doing it locally but on the live environment it works.

But the intention was that you would have the user be pointed into the tab, and then the heading without having to click in

@jhildenbiddle
Copy link
Owner

@markbattistella Well, glad it's fixed! :)

Thanks for taking the time to file the PR. Much appreciated.

@A-Circle-Zhang
Copy link

Hi @jhildenbiddle , thank you for developing and maintaining docsify-tabs.

setActiveTabFromAnchor is not working with routerMode: 'history', which use url query to mark an anchor instead of url hash.
so I just replace window.location.hash with window.location.search for my project.

I think there should be a conditional statement of routerMode in setActiveTabFromAnchor function in index.js.

@jhildenbiddle
Copy link
Owner

Hi @A-Circle-Zhang --

I've made the necessary change on the dev branch. Everything seems to work on my end with routeMode: "history". If you can confirm on your end, I will publish a point release ASAP.

Thanks!

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

No branches or pull requests

3 participants