Giter Club home page Giter Club logo

Comments (5)

PengXing avatar PengXing commented on August 27, 2024

I have encountered the same issue.

from docsify-tabs.

jhildenbiddle avatar jhildenbiddle commented on August 27, 2024

Hi @brcdev --

Apologies for the very slow response on this.

I'm not seeing this behavior on docsify-tabs website which has headings in under "Tab B" and "Tab C" of the "Demo" section. I'm also not seeing it on a local site using the markdown in the repo linked above. Both were tested in Chrome 86, Firefox 82, and Safari 14 on macOS 10.15.7.

Perhaps the issue has been resolved in later versions of Chrome? If you're still seeing the issue, let me know and we'll investigate further.

Closing for now since I was unable to reproduce the issue, but I'm happy to reopen if needed.

Thanks!

from docsify-tabs.

fauxpark avatar fauxpark commented on August 27, 2024

I am also able to reproduce this locally using the above test repo, on Firefox 84, Chrome 87, Edge 87 and Safari 14, on both Windows 10 and macOS 11.

Some further information, since the streamable link is down now:

When switching tabs, the first heading of the previously active tab briefly appears just above the tab contents:
image

If I add some text before the first heading in each tab, the flickering heading issue goes away, but the entire contents of the tab still flicker, instead of instantly changing to the new tab contents.

I agree this bug seems not to be present on the docsify-tabs site, but I have no idea why.

from docsify-tabs.

fauxpark avatar fauxpark commented on August 27, 2024

It seems the bug is present when the theme is set to any of the default docsify themes, and disappears when set to any of the docsify-themeable ones.

EDIT: I have tracked it down to this CSS rule after noticing it still occurred even when I set Firefox to break on DOM mutation of the tabs.

from docsify-tabs.

jhildenbiddle avatar jhildenbiddle commented on August 27, 2024

This issue has been fixed. I will push an update with the change later today. If you are loading docsify-tabs via CDN, it typically takes a day or so for jsdelivr to update their redirects to the latest version.

For those who may be curious what caused the bug, consider how inactive content is hidden:

.docsify-tabs__content {
visibility: hidden;
position: absolute;
overflow: hidden;
height: 0;

As others have pointed out, hiding/showing this content using display: [block|none] is easier and it does solve the problem for basic markdown content. The reason the method of shown above is used is so that hidden tab content has dimensions which is often necessary for content that is initialized via JavaScript such as embeds from places like CodePen, CodeSandbox, etc.

Here is the cause of the inactive content flicker:

.docsify-tabs__content {
padding: var(--docsifytabs-content-padding);

The bug was caused by the fact that padding is visible even when the height of a container is set to 0. The fix was to apply padding only to the active tab content:

.docsify-tabs__tab--active + .docsify-tabs__content {
    padding: var(--docsifytabs-content-padding);
}

Apologies for the slow turnaround on this. I somehow missed @fauxpark's comment where he mentioned the issue only being present when using doscify's default themes (like vue.css). Knowing this is what allowed me to reproduce and fix the bug, so thank you @fauxpark.

from docsify-tabs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.