feat(react): add bootstrap tooltip to menu items

This commit is contained in:
Elian Doran
2025-08-29 11:54:16 +03:00
parent e166b97b8f
commit 83fd42aff2
2 changed files with 29 additions and 2 deletions

View File

@@ -505,7 +505,8 @@ export function useTooltip(elRef: RefObject<HTMLElement>, config: Partial<Toolti
*/
export function useStaticTooltip(elRef: RefObject<Element>, config?: Partial<Tooltip.Options>) {
useEffect(() => {
if (!elRef?.current) return;
const hasTooltip = config?.title || elRef.current?.getAttribute("title");
if (!elRef?.current || !hasTooltip) return;
const $el = $(elRef.current);
$el.tooltip(config);