Event binding of body.ready on mobile devices causes abnormal switching of the sidebar
メンテナーはふだん 2 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript
- 領域
- frontend
調査の方向性
再現可能な CodeSandbox と、1932~1938 行付近にある btn 関数から始めます。button.sidebar-toggle を使ってモバイルデバイスで動作を再現し、その後 body のクリックバインディングを調べ、ボタンが引き続き機能する一方で、サイドバーのクリックによって意図しないトグルが発生しなくなっていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
Bug Report
On mobile devices, docsify will add a click event to the body element.
When the event is not removed, clicking any area in the left sidebar will trigger its switching function.
After removing the event, the function is normal.
Its position is between 1932 -> 1938:
function btn(el) {
var toggle = function (_) {return body.classList.toggle('close'); };
el = getNode(el);
if (el === null || el === undefined) {
return;
}
on(el,'click', function (e) {
e.stopPropagation();
toggle();
});
// this position
isMobile &&
on(
body,
'click',
function (_) {return body.classList.contains('close') && toggle();}
);
}
Just like in the picture, this is when I did not remove the event:

When I removed the event, everything returned to normal:

I don't understand the meaning of this event, because after I disable it, I feel that everything is normal.
Steps to reproduce
On mobile devices, click button.sidebar-toggle. Click again on any area in the sidebar.
What is current behaviour
It will automatically close the sidebar.
What is the expected behaviour
Only when the button.sidebar-toggle button is clicked, can the sidebar toggle function be triggered.
Other relevant information
-
Bug does still occur when all/other plugins are disabled?
-
Your OS: ubuntu 20.04.3 LTS
-
Node.js version: 10.24.1
-
npm/yarn version: 6.4.12
-
Browser version: any browser
-
Docsify version: 4.4.3
-
Docsify plugins:
gitalk
search
emoji
docsify-copy-code
countable
pangu
sidebar
progress
gifcontrol
pagination
Please create a reproducible sandbox
Mention the docsify version in which this bug was not present (if any)
- 主要言語
- JavaScript
- スター
- 31.5k
- フォーク
- 5.8k
- 平均マージ
- 2日 14時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docsifyjs/docsify のほかの issue
-
Query parameter values are truncated at a second equals sign対応中かも @xu91102 が 22 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
bug Triage
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
メンテナーはふだん 2 日以内に返信
-
Cached AJAX responses lose status metadata exposed through vm.route.response対応中かも @xu91102 が 22 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
In the Edge browser, the character `{docsify-updated}` is not replaced再び着手できるかも @AmanUllah687 が 75 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンwait for information
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
docsifyjs/docsify#2681 · コメント 11 件 ·
メンテナーはふだん 2 日以内に返信
-
feature request Triage
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
docsifyjs/docsify#2643 · コメント 5 件 ·
メンテナーはふだん 2 日以内に返信
docsifyjs/docsify の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
HarperFast/harper#3275 ·
メンテナーはふだん 1 日以内に返信
-
bug release:v5.34
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Jason-Vaughan/TangleClaw#2504 ·
メンテナーはふだん 1 日以内に返信
-
bug status: needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
mastra-ai/mastra#27538 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 94/100
Foundryborne/daggerheart#2497 ·
メンテナーはふだん 1 日以内に返信