mirror of
https://github.com/wanderer-industries/wanderer
synced 2026-08-26 07:46:31 +00:00
fix [kills]: prevent virtual scroller from showing unless needed (#225)
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
+15
@@ -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
|
||||
|
||||
+1
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user