Fix liting
This commit is contained in:
@@ -211,17 +211,17 @@ export default function DocumentManager() {
|
|||||||
const positionTooltips = () => {
|
const positionTooltips = () => {
|
||||||
// Get all tooltip containers
|
// Get all tooltip containers
|
||||||
const containers = document.querySelectorAll<HTMLElement>('.tooltip-container');
|
const containers = document.querySelectorAll<HTMLElement>('.tooltip-container');
|
||||||
|
|
||||||
containers.forEach(container => {
|
containers.forEach(container => {
|
||||||
const tooltip = container.querySelector<HTMLElement>('.tooltip');
|
const tooltip = container.querySelector<HTMLElement>('.tooltip');
|
||||||
if (!tooltip) return;
|
if (!tooltip) return;
|
||||||
|
|
||||||
// Only position visible tooltips
|
// Only position visible tooltips
|
||||||
if (getComputedStyle(tooltip).visibility === 'hidden') return;
|
if (getComputedStyle(tooltip).visibility === 'hidden') return;
|
||||||
|
|
||||||
// Get container position
|
// Get container position
|
||||||
const rect = container.getBoundingClientRect();
|
const rect = container.getBoundingClientRect();
|
||||||
|
|
||||||
// Position tooltip above the container
|
// Position tooltip above the container
|
||||||
tooltip.style.left = `${rect.left}px`;
|
tooltip.style.left = `${rect.left}px`;
|
||||||
tooltip.style.top = `${rect.top - 5}px`;
|
tooltip.style.top = `${rect.top - 5}px`;
|
||||||
@@ -235,13 +235,13 @@ export default function DocumentManager() {
|
|||||||
const target = e.target as HTMLElement;
|
const target = e.target as HTMLElement;
|
||||||
const container = target.closest('.tooltip-container');
|
const container = target.closest('.tooltip-container');
|
||||||
if (!container) return;
|
if (!container) return;
|
||||||
|
|
||||||
// Small delay to ensure tooltip is visible before positioning
|
// Small delay to ensure tooltip is visible before positioning
|
||||||
setTimeout(positionTooltips, 10);
|
setTimeout(positionTooltips, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
document.addEventListener('mouseover', handleMouseOver);
|
document.addEventListener('mouseover', handleMouseOver);
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
document.removeEventListener('mouseover', handleMouseOver);
|
document.removeEventListener('mouseover', handleMouseOver);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user