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.

input_pills: Fix `onPillCreate` to update when adding pills with typehead.

Vinit Singhc6e278ab5aad
diff --git a/static/js/input_pill.js b/static/js/input_pill.js
index 1cba2eb5aff..5458503daca 100644
--- a/static/js/input_pill.js
+++ b/static/js/input_pill.js
@@ -78,10 +78,6 @@ exports.create = function (opts) {
return;
}
- if (typeof store.onPillCreate === "function") {
- store.onPillCreate();
- }
-
return item;
},
@@ -114,6 +110,10 @@ exports.create = function (opts) {
opts.img_src = item.img_src;
}
+ if (typeof store.onPillCreate === "function") {
+ store.onPillCreate();
+ }
+
const pill_html = render_input_pill(opts);
payload.$element = $(pill_html);
store.$input.before(payload.$element);