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.

dropdown_widget: Improve arrow navigation experience.

Aman Agrawal781a22bf817e
diff --git a/web/src/dropdown_widget.js b/web/src/dropdown_widget.js
index 0976e81d104..ea47b237816 100644
--- a/web/src/dropdown_widget.js
+++ b/web/src/dropdown_widget.js
@@ -63,6 +63,8 @@ export function setup(tippy_props, get_options, item_click_callback, dropdown_pr
function trigger_element_focus($element) {
e.preventDefault();
e.stopPropagation();
+ // When brining a non-visible element into view, scroll as minimum as possible.
+ $element[0]?.scrollIntoView({block: "nearest"});
$element.trigger("focus");
}