Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
typeahead: Add option for tab to not have enter functionality.
evykassirerc4ff1a115877
diff --git a/web/third/bootstrap-typeahead/typeahead.js b/web/third/bootstrap-typeahead/typeahead.jsindex 8ee3183bd78..71b77d2debf 100644--- a/web/third/bootstrap-typeahead/typeahead.js+++ b/web/third/bootstrap-typeahead/typeahead.js@@ -117,6 +117,14 @@* Some input fields like search have visual changes that need to happen* when the typeahead hides. This callback function is called in `hide()`* and allows those extra UI changes to happen.+ *+ * 13. Allow option to remove custom logic for tab keypresses:+ *+ * Sometimes tab is treated similarly to the escape or enter key, with+ * custom functionality, which also prevents propagation to default tab+ * functionality. The `tabIsEnter` option (default true) lets this be+ * turned off so that tab only does one thing while focus is in the+ * typeahead -- move focus to the next element.* ============================================================ */import {insert} from "text-field-edit";@@ -431,6 +439,7 @@ import {get_string_diff} from "../../src/util";switch(pseudo_keycode) {case 9: // tab+ if (!this.options.tabIsEnter) returncase 13: // entercase 27: // escapee.preventDefault()@@ -487,6 +496,7 @@ import {get_string_diff} from "../../src/util";breakcase 9: // tab+ if (!this.options.tabIsEnter) returncase 13: // enterif (!this.shown) returnthis.select(e)@@ -608,6 +618,7 @@ import {get_string_diff} from "../../src/util";, advanceKeyCodes: [], openInputFieldOnKeyUp: null, closeInputFieldOnHide: null+ , tabIsEnter: true}$.fn.typeahead.Constructor = Typeahead