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.

composebox_typeahead: Improve handling when no text after ```.

Aman Agrawalecb834125015
diff --git a/web/src/composebox_typeahead.ts b/web/src/composebox_typeahead.ts
index 362d232f4ce..ed392166a5d 100644
--- a/web/src/composebox_typeahead.ts
+++ b/web/src/composebox_typeahead.ts
@@ -884,8 +884,13 @@ export function get_candidates(
const syntax_token = current_token.slice(0, 3);
if (ALLOWED_MARKDOWN_FEATURES.syntax && (syntax_token === "```" || syntax_token === "~~~")) {
// Only autocomplete if user starts typing a language after ```
- // unless the fence was added via the code formatting button.
- if (current_token.length === 3 && !compose_ui.code_formatting_button_triggered) {
+ // unless the fence was added via the code formatting button or
+ // the typeahead is already visible.
+ if (
+ current_token.length === 3 &&
+ !compose_ui.code_formatting_button_triggered &&
+ compose_ui.compose_textarea_typeahead === undefined
+ ) {
return [];
}