Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead: Stop using html() to set value from updater().

evykassireraa4e92ee18d3
diff --git a/web/third/bootstrap-typeahead/typeahead.js b/web/third/bootstrap-typeahead/typeahead.js
index d04e0e3253b..c55424ecc48 100644
--- a/web/third/bootstrap-typeahead/typeahead.js
+++ b/web/third/bootstrap-typeahead/typeahead.js
@@ -191,10 +191,10 @@ Typeahead.prototype = {
select(e) {
const val = this.$menu.find(".active").data("typeahead-value");
if (this.$element.is("[contenteditable]")) {
- this.$element.html(this.updater(val, e)).trigger("change");
- // Empty textContent after the change event handler
+ this.$element.text(this.updater(val, e)).trigger("change");
+ // Empty text after the change event handler
// converts the input text to html elements.
- this.$element.html("");
+ this.$element.text("");
} else {
const after_text = this.updater(val, e);
const [from, to_before, to_after] = get_string_diff(this.$element.val(), after_text);