From 8e0b8fd7f95a526da4e308bd2843ec8b5d288d98 Mon Sep 17 00:00:00 2001 From: guarzo Date: Thu, 6 Mar 2025 15:25:29 -0500 Subject: [PATCH] fix [kills]: prevent virtual scroller from showing unless needed (#225) --- .../SolarSystemNode/SolarSystemKillsCounter.tsx | 3 ++- .../SystemKillsContent.module.scss | 15 +++++++++++++++ .../SystemKillsContent/SystemKillsContent.tsx | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx index 2032d777..0c169900 100644 --- a/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx +++ b/assets/js/hooks/Mapper/components/map/components/SolarSystemNode/SolarSystemKillsCounter.tsx @@ -38,7 +38,8 @@ export const KillsCounter = ({ killsCount, systemId, className, children, size = // Calculate height based on number of kills, but ensure a minimum height const killsNeededHeight = limitedKills.length * ITEM_HEIGHT; - const tooltipHeight = Math.max(MIN_TOOLTIP_HEIGHT, Math.min(killsNeededHeight, 500)); + // Add a small buffer (10px) to prevent scrollbar from appearing unnecessarily + const tooltipHeight = Math.max(MIN_TOOLTIP_HEIGHT, Math.min(killsNeededHeight + 10, 500)); const tooltipContent = (