compose: Fix buggy tooltip on validation.

Compose send tooltip was not correctly displayed when the compose
box was in an invalid state.

We significanlty improve the logic for displaying the tooltip here
to provide a more robust experience to the user.
This commit is contained in:
Aman Agrawal
2025-03-17 17:56:01 +05:30
committed by Tim Abbott
parent d43c877a91
commit 4fbf91c135
9 changed files with 97 additions and 75 deletions

View File

@@ -71,14 +71,6 @@ export function initialize() {
compose_ui.handle_keyup(event, $("textarea#compose-textarea").expectOne());
});
$("#compose-send-button").on("mouseenter", () => {
compose_validate.validate(false, false);
compose_validate.update_send_button_status();
});
$("#compose-send-button").on("mouseleave", () => {
$("#compose-send-button").removeClass("disabled-message-send-controls");
});
$("textarea#compose-textarea").on("input propertychange", () => {
if ($("#compose").hasClass("preview_mode")) {
compose.render_preview_area();
@@ -606,6 +598,7 @@ export function initialize() {
const $input = $("input#stream_message_recipient_topic");
$input.val("");
$input.trigger("focus");
compose_validate.validate_and_update_send_button_status();
});
$("input#stream_message_recipient_topic").on("focus", () => {