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
This commit is contained in:
Palash Baderia 2022-10-11 17:50:27 +05:30 committed by Tim Abbott
parent 19d5fedfd2
commit c10d33d23c
1 changed files with 7 additions and 0 deletions

View File

@ -219,6 +219,13 @@ export function initialize() {
// so that regular users don't have to see // so that regular users don't have to see
// them unless they want to. // them unless they want to.
delay: LONG_HOVER_DELAY, 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 // This ensures that the upload files tooltip
// doesn't hide behind the left sidebar. // doesn't hide behind the left sidebar.
appendTo: () => document.body, appendTo: () => document.body,