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

Render the tabs only once #3181

Closed
Mihonarium opened this issue Jul 31, 2020 · 3 comments
Closed

Render the tabs only once #3181

Mihonarium opened this issue Jul 31, 2020 · 3 comments
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@Mihonarium
Copy link

Mihonarium commented Jul 31, 2020

🚀 Feature

To render all the TabItems instead of rendering just the default one, so click on a tab label just changes what tab is visible instead of triggering the rendering of the tab in the runtime of users' browsers.

Have you read the Contributing Guidelines on issues?

Yes.

Motivation

With a large code block under a tab, there's a lag between clicking on a tab and the tab being shown.

Pitch

If all the tabs are being rendered and clicking on a label just changes what tab is visible instead of rendering a new tab, it would:

  • allow search engines to access the content of the tab (currently, only the content of the default tab is rendered in HTML),
  • get rid of noticeable and annoying time between the tab being clicked and being shown when the tab rendering takes some time (e.g. if there's a large code block).
@Mihonarium Mihonarium added feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Jul 31, 2020
@slorber
Copy link
Collaborator

slorber commented Jul 31, 2020

A problem is: rendering all tabs ahead of time can also introduce a lag when we navigate to a large page with a lot of tabs in it :)

Maybe we could have an option to make them render more lazily, but not sure this would play well with server-side rendering, SEO and hydratation...

@slorber slorber added bug An error in the Docusaurus core causing instability or issues with its execution v2 and removed feature This is not a bug or issue with Docusausus, per se. It is a feature request for the future. status: needs triage This issue has not been triaged by maintainers labels Oct 1, 2020
@lex111
Copy link
Contributor

lex111 commented Nov 10, 2020

Implemented in #3706.

@lex111 lex111 closed this as completed Nov 10, 2020
@Mihonarium
Copy link
Author

Implemented in #3706.

Good job, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

No branches or pull requests

3 participants