Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(options): raise revert button tooltip above the options modal
Elian Doran47da5b5815a4
diff --git a/apps/client/src/widgets/react/ActionButton.tsx b/apps/client/src/widgets/react/ActionButton.tsxindex 764e155c44..6471b8e93a 100644--- a/apps/client/src/widgets/react/ActionButton.tsx+++ b/apps/client/src/widgets/react/ActionButton.tsx@@ -9,6 +9,8 @@ import { useStaticTooltip } from "./hooks";export interface ActionButtonProps extends Pick<HTMLAttributes<HTMLButtonElement>, "onClick" | "onAuxClick" | "onContextMenu" | "style"> {text: string;titlePosition?: "top" | "right" | "bottom" | "left";+ /** Extra class applied to the tooltip popup (e.g. `tooltip-top` to raise its z-index above modals). */+ tooltipClass?: string;icon: string;className?: string;triggerCommand?: CommandNames;@@ -20,7 +22,7 @@ export interface ActionButtonProps extends Pick<HTMLAttributes<HTMLButtonElementconst cachedIsMobile = isMobile();-export default function ActionButton({ text, icon, className, triggerCommand, titlePosition, noIconActionClass, frame, active, disabled, ...restProps }: ActionButtonProps) {+export default function ActionButton({ text, icon, className, triggerCommand, titlePosition, tooltipClass, noIconActionClass, frame, active, disabled, ...restProps }: ActionButtonProps) {const buttonRef = useRef<HTMLButtonElement>(null);const [ keyboardShortcut, setKeyboardShortcut ] = useState<string[]>();@@ -28,6 +30,7 @@ export default function ActionButton({ text, icon, className, triggerCommand, tititle: keyboardShortcut?.length ? `${text} (${keyboardShortcut?.join(",")})` : text,placement: titlePosition ?? "bottom",fallbackPlacements: [ titlePosition ?? "bottom" ],+ customClass: tooltipClass ?? "",trigger: cachedIsMobile ? "focus" : "hover focus",animation: false});diff --git a/apps/client/src/widgets/type_widgets/options/shortcuts.tsx b/apps/client/src/widgets/type_widgets/options/shortcuts.tsxindex 69633a31f7..4241bdc1f2 100644--- a/apps/client/src/widgets/type_widgets/options/shortcuts.tsx+++ b/apps/client/src/widgets/type_widgets/options/shortcuts.tsx@@ -186,6 +186,7 @@ function ShortcutRow({ action }: { action: ActionKeyboardShortcut }) {<ActionButtonicon="bx bx-reset"text={t("shortcuts.revert_to_default", { shortcuts: formatDefaultShortcuts(action) })}+ tooltipClass="tooltip-top"onClick={() => revertShortcut(action)}/>}</div>