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: Fix dropdown not displayed on mobile.

Aman Agrawale75ac2bfd183
diff --git a/web/src/dropdown_widget.ts b/web/src/dropdown_widget.ts
index 9ad3e233345..3ef5ef9d175 100644
--- a/web/src/dropdown_widget.ts
+++ b/web/src/dropdown_widget.ts
@@ -15,6 +15,7 @@ import {page_params} from "./page_params";
import * as popover_menus from "./popover_menus";
import type {StreamSubscription} from "./sub_store";
import {parse_html} from "./ui_util";
+import * as util from "./util";
/* Sync with max-height set in zulip.css */
export const DEFAULT_DROPDOWN_HEIGHT = 210;
@@ -191,6 +192,14 @@ export class DropdownWidget {
theme: "dropdown-widget",
arrow: false,
onShow: (instance: tippy.Instance) => {
+ if (util.is_mobile()) {
+ // The dropdown trigger button can be hidden by the
+ // keyboard on mobile or if it is scrolled out of
+ // view to keyboard being displayed.
+ // So, we show the dropdown even if reference is hidden on
+ // mobile.
+ $(instance.popper).find(".tippy-box").addClass("show-when-reference-hidden");
+ }
instance.setContent(
parse_html(
render_dropdown_list_container({