mirror of
https://github.com/zadam/trilium.git
synced 2026-01-03 13:14:24 +01:00
fix(inline_title): prevent flicker when updating tooltip
This commit is contained in:
parent
7a1ea8833f
commit
df05101e93
@ -1,9 +1,10 @@
|
||||
import "./InlineTitle.css";
|
||||
|
||||
import { NoteType } from "@triliumnext/commons";
|
||||
import { Tooltip } from "bootstrap";
|
||||
import clsx from "clsx";
|
||||
import { ComponentChild } from "preact";
|
||||
import { useLayoutEffect, useRef, useState } from "preact/hooks";
|
||||
import { useLayoutEffect, useMemo, useRef, useState } from "preact/hooks";
|
||||
import { Trans } from "react-i18next";
|
||||
|
||||
import { ViewScope } from "../../services/link";
|
||||
@ -108,11 +109,13 @@ function TextWithValue({ i18nKey, value, valueTooltip }: {
|
||||
valueTooltip: string;
|
||||
}) {
|
||||
const listItemRef = useRef<HTMLLIElement>(null);
|
||||
useStaticTooltip(listItemRef, {
|
||||
const tooltipConfig: Partial<Tooltip.Options> = useMemo(() => ({
|
||||
selector: "span.value",
|
||||
title: valueTooltip,
|
||||
popperConfig: { placement: "bottom" }
|
||||
});
|
||||
popperConfig: { placement: "bottom" },
|
||||
animation: false
|
||||
}), [ valueTooltip ]);
|
||||
useStaticTooltip(listItemRef, tooltipConfig);
|
||||
|
||||
return (
|
||||
<li ref={listItemRef}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user