Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose (misc): Fix send message on enter in topic input. #32975

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
compose (misc): Fix send message on enter in topic input.
This commit prevents sending the message when pressing
enter while on focus at topic input box.

Fixes: #32596
Co-Authored-By: amanagr
  • Loading branch information
Harshbansal8705 committed Jan 10, 2025
commit f887f48c5acd49f228e747aacb39a8aa6f73b2b6
4 changes: 4 additions & 0 deletions web/src/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,3 +401,7 @@ function schedule_message_to_custom_date() {
error,
});
}

export function is_topic_focus() {
return $("#stream_message_recipient_topic").is(":focus");
}
2 changes: 1 addition & 1 deletion web/src/hotkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ export function process_enter_key(e) {
}

if (processing_text()) {
if (stream_list.searching()) {
if (stream_list.searching() || compose.is_topic_focus()) {
// This is sort of funny behavior, but I think
// the intention is that we want it super easy
// to close stream search.
Expand Down
Loading