Skip to content

Commit

Permalink
left-sidebar: Fix opening of compose box on narrowing using hotkeys.
Browse files Browse the repository at this point in the history
Explaining the problem a bit: When we narrow to a stream/private message
using `q+Enter`/`w+Enter` compose box opens which isn't desirable here.
The bug here was the propagation of event after getting handled in
`keydown_util.handle` to `hotkeys.process_enter_key`.

Fixes: zulip#9679.
  • Loading branch information
shubhamdhama authored and showell committed Jun 9, 2018
1 parent 283d530 commit 51ae82f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions frontend_tests/node_tests/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ zrequire('components');

var noop = function () {};

var LEFT_KEY = { which: 37, preventDefault: noop };
var RIGHT_KEY = { which: 39, preventDefault: noop };
var LEFT_KEY = { which: 37, preventDefault: noop, stopPropagation:noop };
var RIGHT_KEY = { which: 39, preventDefault: noop, stopPropagation:noop };

run_test('basics', () => {
var keydown_f;
Expand Down
1 change: 1 addition & 0 deletions static/js/keydown_util.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ exports.handle = function (opts) {

if (handled) {
e.preventDefault();
e.stopPropagation();
}
});
};
Expand Down

0 comments on commit 51ae82f

Please sign in to comment.