Skip to content

Commit dc8f3d5

Browse files
committed
fix: add role tooltip to a static element to preserve its functionality and prevent lint issue
1 parent aa7fec9 commit dc8f3d5

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

apps/dashboard/components/analytics/map-component.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,14 +230,6 @@ export function MapComponent({
230230
return (
231231
<div
232232
className="relative"
233-
onMouseMove={(e) => {
234-
if (tooltipContent) {
235-
setTooltipPosition({
236-
x: e.clientX,
237-
y: e.clientY,
238-
});
239-
}
240-
}}
241233
ref={containerRef}
242234
style={{ height }}
243235
>
@@ -280,13 +272,20 @@ export function MapComponent({
280272

281273
{tooltipContent && (
282274
<div
275+
role="tooltip"
283276
className="pointer-events-none fixed z-50 rounded-lg border border-gray-200 bg-white p-3 text-gray-900 text-sm shadow-xl backdrop-blur-sm dark:border-gray-700 dark:bg-gray-900 dark:text-white"
284277
style={{
285278
left: tooltipPosition.x,
286279
top: tooltipPosition.y - 10,
287280
transform: "translate(-50%, -100%)",
288281
boxShadow: "0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",
289282
}}
283+
onMouseMove={(e) => {
284+
setTooltipPosition({
285+
x: e.clientX,
286+
y: e.clientY,
287+
});
288+
}}
290289
>
291290
<div className="mb-1 flex items-center gap-2 font-medium">
292291
{tooltipContent.code && <CountryFlag country={tooltipContent.code.slice(0, 2)} />}

apps/dashboard/hooks/use-dynamic-query.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -611,11 +611,11 @@ export function useMapLocationData(
611611
parameters: ["country"],
612612
limit: 100,
613613
},
614-
// {
615-
// id: "map-regions",
616-
// parameters: ["region"],
617-
// limit: 100,
618-
// },
614+
{
615+
id: "map-regions",
616+
parameters: ["region"],
617+
limit: 100,
618+
},
619619
];
620620

621621
return useBatchDynamicQuery(websiteId, dateRange, queries, options);

0 commit comments

Comments
 (0)