From c10d33d23cc8fe5bbcf0d5e4b6fe6ad64ebb9d23 Mon Sep 17 00:00:00 2001 From: Palash Baderia Date: Tue, 11 Oct 2022 17:50:27 +0530 Subject: [PATCH] tippy: Remove the focus trigger from the compose-control-buttons. By default, tippyjs uses a trigger value of 'mouseenter focus', which means that the tooltips can appear either when the element is hovered over or when it receives focus (e.g., by being clicked). Because of this, if you click on the button to open the popover, the tooltip also appears. To prevent this behavior, we need to remove the 'focus' trigger from the buttons so that the tooltips don't appear when the buttons are clicked. Fixes: #25277 --- web/src/tippyjs.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/web/src/tippyjs.js b/web/src/tippyjs.js index 2c926d6a8d..1a85f9fb57 100644 --- a/web/src/tippyjs.js +++ b/web/src/tippyjs.js @@ -219,6 +219,13 @@ export function initialize() { // so that regular users don't have to see // them unless they want to. delay: LONG_HOVER_DELAY, + // By default, tippyjs uses a trigger value of "mouseenter focus", + // which means the tooltips can appear either when the element is + // hovered over or when it receives focus (e.g. by being clicked). + // However, we only want the tooltips to appear on hover, not on click. + // Therefore, we need to remove the "focus" trigger from the buttons, + // so that the tooltips don't appear when the buttons are clicked. + trigger: "mouseenter", // This ensures that the upload files tooltip // doesn't hide behind the left sidebar. appendTo: () => document.body,