victorvoid / space-jekyll-template

A simple spacemacs template on jekyll. https://victorvoid.github.io/space-jekyll-template/
Other
400 stars 324 forks source link

fix(/src/js/zmain.js): extra char search input #19

Closed SAW4 closed 7 years ago

SAW4 commented 7 years ago

Problem: The keydown() event trigger click() + focus(), causing extra character 's' captured to the input field. The focus() event should delay and put into keyup() event.

Commit: Every keyup() trigger if search panel is active, then focus() to its input field, else blur() to unfocus.

Another option is clear the input field each time when switching to the search panel, but the previous record entered by user cannot be kept, so I think the first approach is better.

victorvoid commented 7 years ago

I also think the first one is better. Thanks!