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: Focus textarea after narrowing to compose target.

Karl Stolley4fbd10ba5d7f
diff --git a/web/src/compose_actions.ts b/web/src/compose_actions.ts
index ed8be01c5e5..074f40ea797 100644
--- a/web/src/compose_actions.ts
+++ b/web/src/compose_actions.ts
@@ -635,6 +635,10 @@ export function on_narrow(opts: NarrowActivateOpts): void {
if (opts.trigger === "narrow_to_compose_target") {
compose_fade.update_message_list();
+ // When narrowing to a compose target, focus the compose
+ // area, under the assumption that someone so narrowing
+ // is ready to compose their message.
+ $("#compose-textarea").trigger("focus");
return;
}