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.

bootstrap_typeahead: Fix not being displayed on mobile.

Aman Agrawal135f31468fa9
diff --git a/web/src/bootstrap_typeahead.ts b/web/src/bootstrap_typeahead.ts
index 77e9fbb9b51..2385591bc2c 100644
--- a/web/src/bootstrap_typeahead.ts
+++ b/web/src/bootstrap_typeahead.ts
@@ -451,13 +451,21 @@ export class Typeahead<ItemType extends string | object> {
// We have event handlers to hide the typeahead, so we
// don't want tippy to hide it for us.
hideOnClick: false,
+ onMount: () => {
+ // The container has `display: none` as a default style.
+ // We make sure to display it. For tippy elements, this
+ // must happen after we insert the typeahead into the DOM.
+ this.$container.show();
+ },
});
}
- // The container has `display: none` as a default style. We make sure to display
- // it. For tippy elements, this must happen after we insert the typeahead into
- // the DOM.
- this.$container.show();
+ if (this.non_tippy_parent_element) {
+ // Call this after $container is in DOM which is true here since
+ // that happens in the constructor for non-tippy typeaheads.
+ this.$container.show();
+ }
+
return this;
}