From 7b60b2edcaa886bea7d0c17fec4ad978ab10a3b0 Mon Sep 17 00:00:00 2001 From: Vector73 Date: Mon, 7 Jul 2025 09:07:03 +0000 Subject: [PATCH] stream_popover: Show clear button if topic input is not disabled. Previously, if the topic input was disabled when "Move messages" modal was opened, the clear button was not added to the DOM which caused the bug where the clear button was not shown even if the topic input was later enabled because user was allowed to edit topics in the selected channel. --- web/src/stream_popover.ts | 3 ++- web/templates/move_topic_to_stream.hbs | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/web/src/stream_popover.ts b/web/src/stream_popover.ts index 45c3cbfb21..9dbef6d169 100644 --- a/web/src/stream_popover.ts +++ b/web/src/stream_popover.ts @@ -884,6 +884,7 @@ export async function build_move_topic_to_stream_popover( set_stream_topic_typeahead(); render_selected_stream(); maybe_show_topic_already_exists_warning(); + update_clear_move_topic_button_state(); update_topic_input_placeholder_visibility(topic_input_value); const selected_propagate_mode = String($("#message_move_select_options").val()); void warn_unsubscribed_participants(selected_propagate_mode); @@ -989,7 +990,7 @@ export async function build_move_topic_to_stream_popover( function update_clear_move_topic_button_state(): void { const $clear_topic_name_button = $("#clear_move_topic_new_topic_name"); const topic_input_value = $("input#move-topic-new-topic-name").val(); - if (topic_input_value === "") { + if (topic_input_value === "" || $("input#move-topic-new-topic-name").prop("disabled")) { $clear_topic_name_button.css("visibility", "hidden"); } else { $clear_topic_name_button.css("visibility", "visible"); diff --git a/web/templates/move_topic_to_stream.hbs b/web/templates/move_topic_to_stream.hbs index 2bf0ef2970..7370930c03 100644 --- a/web/templates/move_topic_to_stream.hbs +++ b/web/templates/move_topic_to_stream.hbs @@ -14,11 +14,9 @@ {{> topic_not_mandatory_placeholder_text empty_string_topic_display_name=empty_string_topic_display_name}} - {{#unless disable_topic_input}} - {{/unless}}