docsify icon indicating copy to clipboard operation
docsify copied to clipboard

Fix: fix collapse selector

Open Embers-of-the-Fire opened this issue 2 years ago • 3 comments

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
  • [x] No

Tested in the following browsers:

  • [x] Chrome
  • [ ] Firefox
  • [ ] Safari
  • [x] Edge
  • [ ] IE

Embers-of-the-Fire avatar Jul 03 '23 03:07 Embers-of-the-Fire

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

vercel[bot] avatar Jul 03 '23 03:07 vercel[bot]

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

Embers-of-the-Fire avatar Jul 03 '23 04:07 Embers-of-the-Fire

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 avatar Jul 03 '23 09:07 trusktr