left_sidebar: Fix tooltips not hidden on blur.

The elements which received focus didn't have tooltips attached to
them, thus when blur was triggered on `a`, the tooltip didn't hide
as it was not listening on it for the blur event.

We move the toolip to `a` elements so that when focus and blur
are triggered tippy is able to capture them.
This commit is contained in:
Aman Agrawal
2024-06-20 09:59:06 +00:00
committed by Tim Abbott
parent 79fc430b56
commit 23927ea5b1
2 changed files with 20 additions and 10 deletions

View File

@@ -167,6 +167,16 @@ export function initialize(): void {
if ($container.data("view-code") === user_settings.web_home_view) {
$container.find(".views-tooltip-home-view-note").removeClass("hide");
}
// Since the tooltip is attached the anchor tag which doesn't
// include with of the ellipsis icon, we need to offset the
// tooltip so that the tooltip is displayed to right of the
// ellipsis icon.
if (instance.reference.classList.contains("left-sidebar-navigation-label-container")) {
instance.setProps({
offset: [0, 40],
});
}
},
onHidden(instance) {
instance.destroy();