Fix: fix collapse selector
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.
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
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 |
Eee, I don't know why the ci failed, as I've tested it locally and there's no error.
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.