mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
compose: Replace empty message banner with red outline for compose box.
Previously, we showed an empty message banner if the user tried to send an empty message. We only showed it for users with "ctrl+enter to send" because we thought it might be easy for a user to press just enter accidentally. However, this missed the case where the user clicks on the Enter button. We want to show the user something in this case to tell them that they're missing message content. To avoid more complicated logic, this PR removes the banner completely and changes the compose box border to red if the user tries to send an empty message (for all cases). The red line goes away as soon as the composebox has non-whitespace characters.
This commit is contained in:
@@ -445,6 +445,9 @@ export function initialize() {
|
||||
$("#compose-textarea").on("input propertychange", () => {
|
||||
compose_validate.warn_if_topic_resolved(false);
|
||||
const compose_text_length = compose_validate.check_overflow_text();
|
||||
if (compose_text_length !== 0 && $("#compose-textarea").hasClass("invalid")) {
|
||||
$("#compose-textarea").toggleClass("invalid", false);
|
||||
}
|
||||
// Change compose close button tooltip as per condition.
|
||||
// We save compose text in draft only if its length is > 2.
|
||||
if (compose_text_length > 2) {
|
||||
|
||||
Reference in New Issue
Block a user