mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 02:17:19 +00:00
Workaround missing keyup event when user types ctrl-f.
(imported from commit ad37e0c9069ee29dd8159e020682cc05738b300b)
This commit is contained in:
@@ -157,6 +157,20 @@ exports.set_compose = function () {
|
||||
|
||||
$(document).keydown(function (e) {
|
||||
pressed_keys[e.which] = true;
|
||||
if ((num_pressed_keys() >= 2) &&
|
||||
(48 <= event.which && event.which <= 90) &&
|
||||
(pressed_keys[17] === true ||
|
||||
pressed_keys[91] === true)) {
|
||||
// If the user typed 2 or more characters, one of which was
|
||||
// ctrl(17) or command(91), and ending with an alphanumeric
|
||||
// character (between 48 and 90), this is probably a browser
|
||||
// keyboard shortcut (example: ctrl-f in Chrome). Browsers
|
||||
// will often not trigger a keyup event after processing those
|
||||
// shortcuts and we don't have any hotkeys using these
|
||||
// characters, so just ignore such key presses for our
|
||||
// accounting.
|
||||
pressed_keys = {};
|
||||
}
|
||||
});
|
||||
|
||||
$(document).keyup(function (e) {
|
||||
|
||||
Reference in New Issue
Block a user