Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/plugins/search/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,20 @@ function bindEvents() {
const $inputWrap = Docsify.dom.find($search, '.input-wrap');

let timeId;
// Prevent to Fold sidebar

/**
Prevent to Fold sidebar.

When searching on the mobile end,
the sidebar is collapsed when you click the INPUT box,
making it impossible to search.
*/
Docsify.dom.on(
$search,
'click',
e => e.target.tagName !== 'A' && e.stopPropagation()
e =>
['A', 'H2', 'P', 'EM'].indexOf(e.target.tagName) === -1 &&
e.stopPropagation()
);
Docsify.dom.on($input, 'input', e => {
clearTimeout(timeId);
Expand Down