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: fix collapse selector #2113

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

Conversation

Embers-of-the-Fire
Copy link

Summary

The initial selector uses element.nextSibling, which may select an empty #text on Chromium-based browsers.

Here is an instance:

For a link in the sidebar, it usually seems like this:

<li>
    <a href="link" title="foo">foo</a>
    <ul class="app-sub-sidebar">...</ul>
</li>

The collapsing function uses element.nextSibling to check if collapsing is needed. However, in Chromium-based browsers, a blank text tag will possibly be inserted, making the directory unable to collapse.

bug

What kind of change does this PR introduce?

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

This is a small fix so there's no test related.

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE

@vercel
Copy link

vercel bot commented Jul 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 3, 2023 3:49am

@Embers-of-the-Fire
Copy link
Author

Eee, I don't know why the ci failed, as I've tested it locally and there's no error.

@trusktr
Copy link
Member

trusktr commented Jul 3, 2023

Hello, thanks!

Eee, I don't know why the ci failed, as I've tested it locally and there's no error.

It didn't fail, I had to hit approve to make ci run.

@trusktr trusktr requested a review from a team July 3, 2023 09:14
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.

None yet

2 participants