mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
compose_tooltips: Fix message edit tooltip visible without mousemove.
Fixes #34009 Fixed by only initializing tippy instance once user moves mouse.
This commit is contained in:
@@ -52,7 +52,7 @@ export function clean_up_compose_singleton_tooltip(context: SingletonContext): v
|
||||
|
||||
export function initialize_compose_tooltips(context: SingletonContext, selector: string): void {
|
||||
// Listen on body for the very first mouseenter on any element matching `selector`
|
||||
$(document.body).one("mouseenter", selector, () => {
|
||||
$(document.body).one("mousemove", selector, (e) => {
|
||||
// Clean up existing instances first
|
||||
clean_up_compose_singleton_tooltip(context);
|
||||
|
||||
@@ -81,6 +81,11 @@ export function initialize_compose_tooltips(context: SingletonContext, selector:
|
||||
},
|
||||
});
|
||||
|
||||
// Show the tooltip since user has hovered over the element.
|
||||
if (e.currentTarget instanceof HTMLElement) {
|
||||
e.currentTarget.dispatchEvent(new MouseEvent("mouseenter"));
|
||||
}
|
||||
|
||||
compose_button_singleton_context_map.set(context, {
|
||||
tooltip_instances,
|
||||
singleton_instance,
|
||||
|
Reference in New Issue
Block a user