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

fix: incorrect scrolling to anchor #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

stdword
Copy link

@stdword stdword commented Jul 6, 2024

Hello!
I want to return to this story with anchor positioning.
I'm aware of your (@jhildenbiddle) comments here and agree with them: this work should be done on docsify's side and in general (for plugins and images). It is currently 2024, so we are waiting for this feature in docsify any minute now.

But there is the one simple solution, you can make to drastically reduce impact of such annoying and imperfect bug.
Lets just take the first tab and make it's content height visible on CSS level. With turned off persistent mode it solves the issue! Just because it does it's job before setDefaultTabs() in hook.doneEach.

Perhaps this will give you some thoughts on how to handle the persistent mode. For me, this solution proved to be sufficient.

If someone want to use it before this PR is merged — here is the CSS code:

.docsify-tabs:not(:has(> button.docsify-tabs__tab--active)) > .docsify-tabs__content[class]:nth-child(2) {
    visibility: visible;
    position: relative;
    overflow: auto;
    height: auto;

    padding: var(--docsifytabs-content-padding);
}

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.

1 participant