fix [kills]: prevent virtual scroller from showing unless needed (#225)

This commit is contained in:
guarzo
2025-03-07 00:25:29 +04:00
committed by GitHub
parent ee8f9e4d24
commit 8e0b8fd7f9
3 changed files with 18 additions and 1 deletions
@@ -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 = (
<div
@@ -2,11 +2,26 @@
.scrollerContent {
overflow-x: hidden;
overflow-y: auto;
padding-right: 8px;
padding-left: 8px;
height: 100% !important;
}
// VirtualScroller specific styles that can't be handled with Tailwind
.VirtualScroller {
overflow: hidden !important;
display: flex !important;
flex-direction: column !important;
height: 100% !important;
// Target this specific VirtualScroller instance
&:global(.p-virtualscroller) {
height: 100% !important;
:global(.p-virtualscroller-content) {
height: 100% !important;
}
}
}
// Fix for PrimeReact VirtualScroller - these need to be global
@@ -52,6 +52,7 @@ export const SystemKillsContent: React.FC<SystemKillsContentProps> = ({
// Define style for the VirtualScroller
const virtualScrollerStyle: React.CSSProperties = {
boxSizing: 'border-box',
height: '100%', // Use 100% height to fill the container
};
return (