Skip to content

Commit

Permalink
preventDefault on ctrl+shift+p, and tabindex=0 to focus first
Browse files Browse the repository at this point in the history
should solve wbond#28
  • Loading branch information
math2001 committed Sep 28, 2016
1 parent fb685f1 commit 6a143b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/js/header.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class App.Header extends Backbone.View
# Allow users to use ctrl+shift+p or cmd+shift+p to focus search
window.keymaster('command+shift+p, ctrl+shift+p', (e) =>
@$search.focus()
e.preventDefault()
)

window.keymaster('enter', 'search', (e) =>
Expand Down
2 changes: 1 addition & 1 deletion app/templates/partials/header.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
</div>

<form action="/search" method="get">
<input id="search" type="text" placeholder="Search" name="terms" value="{{terms}}">
<input id="search" type="text" placeholder="Search" name="terms" value="{{terms}}" tabindex="0">
<span class="help">
<span class="keys">ctrl+shift+p</span>
<span class="terms">
Expand Down

0 comments on commit 6a143b1

Please sign in to comment.