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.

saved_snippets: Fix Enter click on "Create a new saved snippet" button.

Vector7355f1c2d90f1c
diff --git a/web/src/dropdown_widget.ts b/web/src/dropdown_widget.ts
index 36710a93e96..f838a8eb286 100644
--- a/web/src/dropdown_widget.ts
+++ b/web/src/dropdown_widget.ts
@@ -391,7 +391,12 @@ export class DropdownWidget {
switch (e.key) {
case "Enter":
- if (e.target === $search_input.get(0)) {
+ if (
+ list_items.length === 0 ||
+ e.target === $sticky_bottom_option.get(0)
+ ) {
+ $sticky_bottom_option.trigger("click");
+ } else if (e.target === $search_input.get(0)) {
// Select first item if in search input.
first_item().trigger("click");
} else if (list_items.length > 0) {