From 5ce956c9bb733372934817308dfdbfc2db87e2b2 Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Mon, 6 Oct 2025 15:35:36 -0500 Subject: [PATCH] compose: Clear recipient-focused timeout before setting another. --- web/src/compose_setup.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/web/src/compose_setup.ts b/web/src/compose_setup.ts index 151f2b6685..7ca7cae764 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();