mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix: consistent location of search result
* fix 1098 * Update component.js * Update component.js
This commit is contained in:
parent
c0d32805c9
commit
e9dd2de384
@ -171,11 +171,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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user