Skip to content

Commit 3941304

Browse files
committedFeb 11, 2017
fix(search): not work in mobile
1 parent be6a97a commit 3941304

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed
 

‎src/plugins/search.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ class SearchComponent {
180180
}
181181

182182
bindEvent () {
183-
const input = document.querySelector('.search input')
184-
const panel = document.querySelector('.results-panel')
183+
const search = document.querySelector('.search')
184+
const input = search.querySelector('.search input')
185+
const panel = search.querySelector('.results-panel')
185186

187+
search.addEventListener('click', e => e.target.tagName !== 'A' && e.stopPropagation())
186188
input.addEventListener('input', e => {
187189
const target = e.target
188190

0 commit comments

Comments
 (0)
Please sign in to comment.