Skip to content

Commit

Permalink
Ensure keyboard events work in chrome as well.
Browse files Browse the repository at this point in the history
Turns out keypress doesn't fire for all keys in Chrome - but it does in
Firefox.
  • Loading branch information
Greenheart committed May 20, 2018
1 parent 3d94270 commit 36f9a5d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $(function () {
})

// Press Escape key to close menu
$(window).keypress(function (e) {
$(window).keydown(function (e) {
if (e.key === 'Escape') {
if (flexContainer.hasClass('active')) {
flexContainer.removeClass('active')
Expand Down

0 comments on commit 36f9a5d

Please sign in to comment.