left-sidebar: Fix opening of compose box on narrowing using hotkeys.

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: #9679.
This commit is contained in:
Shubham Dhama
2018-06-09 11:36:49 +05:30
committed by showell
parent 283d530f68
commit 51ae82fbcf
2 changed files with 3 additions and 2 deletions

View File

@@ -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;

View File

@@ -32,6 +32,7 @@ exports.handle = function (opts) {
if (handled) {
e.preventDefault();
e.stopPropagation();
}
});
};