Skip to content

Build your personal knowledge base with Trilium Notes

chore(react): monkey patch boostrap tooltip handling

Elian Doranfbd47025d63a
diff --git a/apps/client/src/widgets/react/hooks.tsx b/apps/client/src/widgets/react/hooks.tsx
index 9e6991f084..6a4b4ab154 100644
--- a/apps/client/src/widgets/react/hooks.tsx
+++ b/apps/client/src/widgets/react/hooks.tsx
@@ -536,7 +536,12 @@ export function useStaticTooltip(elRef: RefObject<Element>, config?: Partial<Too
if (!elRef?.current || !hasTooltip) return;
const tooltip = Tooltip.getOrCreateInstance(elRef.current, config);
- return () => tooltip.dispose();
+ return () => {
+ tooltip.dispose();
+ // workaround for https://github.com/twbs/bootstrap/issues/37474
+ (tooltip as any)._activeTrigger = {};
+ (tooltip as any)._element = document.createElement('noscript'); // placeholder with no behavior
+ }
}, [ elRef, config ]);
}