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 AssertionError due to `onHidden` not called.

Aman Agrawal431145d4f27d
diff --git a/web/src/bootstrap_typeahead.ts b/web/src/bootstrap_typeahead.ts
index f0ae7117ed0..4c308fc007e 100644
--- a/web/src/bootstrap_typeahead.ts
+++ b/web/src/bootstrap_typeahead.ts
@@ -379,11 +379,6 @@ 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,
- onHidden: () => {
- assert(this.instance !== undefined);
- this.instance.destroy();
- this.instance = undefined;
- },
});
return this;
@@ -394,7 +389,8 @@ export class Typeahead<ItemType extends string | object> {
if (this.parentElement) {
this.$container.hide();
} else {
- this.instance?.hide();
+ this.instance?.destroy();
+ this.instance = undefined;
}
if (this.closeInputFieldOnHide !== undefined) {