mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
saved_snippets: Fix Enter click on "Create a new saved snippet" button.
Using "Enter" key to click on "Create a new saved snippet" does not work when the dropdown list is empty. This commit fixes that bug.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user