mirror of
https://github.com/zulip/zulip.git
synced 2025-11-01 20:44:04 +00:00
typeahead: Fix buggy advanceKeyCodes code.
The `advanceKeyCodes` option was introduced in #10092. It included a buggy check for `$.inArray` that returned a falsey value only when the keycode was the first element of `advanceKeyCodes`. Because the only instance of `advanceKeyCodes` right now is for search and contains only one element, this change is functionally equivalent.
This commit is contained in:
@@ -435,7 +435,7 @@ Typeahead.prototype = {
|
||||
const pseudo_keycode = get_pseudo_keycode(e);
|
||||
if (
|
||||
(this.options.stopAdvance || (pseudo_keycode !== 9 && pseudo_keycode !== 13)) &&
|
||||
$.inArray(e.keyCode, this.options.advanceKeyCodes)
|
||||
!this.options.advanceKeyCodes.includes(e.keyCode)
|
||||
) {
|
||||
e.stopPropagation();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user