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.

compose: Clear recipient-focused timeout before setting another.

Karl Stolley5ce956c9bb73
diff --git a/web/src/compose_setup.ts b/web/src/compose_setup.ts
index 151f2b66857..7ca7cae7642 100644
--- a/web/src/compose_setup.ts
+++ b/web/src/compose_setup.ts
@@ -684,6 +684,12 @@ export function initialize(): void {
// we update these things immediately so that no delay is
// apparent on the topic's displayed text or the placeholder
// in the empty compose textarea.
+ // Also, in case a user quickly opens and closes the compose
+ // box, we need to clear a previously set timeout before
+ // setting a new one. Otherwise, the compose box can open
+ // in a strange state displaying *general chat* and italicizing
+ // the topic input.
+ clearTimeout(recipient_focused_timeout);
recipient_focused_timeout = setTimeout(() => {
compose_recipient.update_topic_displayed_text($input.val());
compose_recipient.update_compose_area_placeholder_text();