message_edit: Fix tooltip not hidden on closing message edit form.

Bug:
A tooltip appears on hovering over a control button in the
message edit form. Now when the form was closed either using
Esc key (cancel) or Enter / Ctrl + Enter (save), the tooltip
didn't disappear. This resulted in a random tooltip visible
in the message list view.

Fix:
Since tippyjs doesn't hide tooltip even after the element is
hidden we need to explicitly hide the tooltip in those cases.
See https://github.com/atomiks/tippyjs/issues/938

This commit fixes the above mentioned bug by explicitly hiding
the tooltip instance.
This commit is contained in:
Prakhar Pratyush
2024-07-18 21:46:06 +05:30
committed by Tim Abbott
parent 2be9774192
commit e1f3c54a1d
3 changed files with 13 additions and 0 deletions

View File

@@ -248,3 +248,11 @@ export function initialize(): void {
},
});
}
export function hide_compose_control_button_tooltips($row: JQuery): void {
$row.find(
".compose_control_button[data-tooltip-template-id], .compose_control_button[data-tippy-content], .compose_control_button_container",
).each(function (this: tippy.ReferenceElement) {
this._tippy?.hide();
});
}