Skip to content

Commit 2a021a8

Browse files
authored
NETOBSERV-1485 Single focus sizing issue (#470)
* force overview div size * hide graph overflow
1 parent 613a568 commit 2a021a8

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

web/src/components/netflow-overview/netflow-overview.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
min-width: 50%;
1818
flex: 1;
1919
align-self: flex-start;
20+
overflow: hidden;
2021
}
2122

2223
.overview-flex-item.center {

web/src/components/netflow-overview/netflow-overview.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ export const NetflowOverview: React.FC<NetflowOverviewProps> = ({
8585
const containerRef = React.createRef<HTMLDivElement>();
8686
const [containerSize, setContainerSize] = React.useState<DOMRect>({ width: 0, height: 0 } as DOMRect);
8787
const [sidePanelWidth, setSidePanelWidth] = React.useState<number>(0);
88+
const [offsetTop, setOffsetTop] = React.useState<number>(0);
8889

8990
const setKebabOptions = React.useCallback(
9091
(id: OverviewPanelId, options: PanelKebabOptions) => {
@@ -137,6 +138,7 @@ export const NetflowOverview: React.FC<NetflowOverviewProps> = ({
137138
React.useEffect(() => {
138139
observeDOMRect(containerRef, containerSize, setContainerSize);
139140
setSidePanelWidth(document.getElementById('summaryPanel')?.clientWidth || 0);
141+
setOffsetTop(containerRef.current?.offsetTop || 0);
140142
}, [containerRef, containerSize]);
141143

142144
React.useEffect(() => {
@@ -683,15 +685,19 @@ export const NetflowOverview: React.FC<NetflowOverviewProps> = ({
683685
} else {
684686
return (
685687
<div
686-
style={{ padding: `${containerPadding}px 0 ${containerPadding}px ${containerPadding}px` }}
688+
style={{
689+
width: '100%',
690+
height: '100%',
691+
padding: `${containerPadding}px 0 ${containerPadding}px ${containerPadding}px`
692+
}}
687693
ref={containerRef}
688694
>
689695
{allowFocus && selectedPanel && (
690696
<div
691697
id="overview-absolute-graph"
692698
style={{
693699
position: 'absolute',
694-
top: containerSize.top,
700+
top: offsetTop,
695701
right: containerSize.width / 5 + sidePanelWidth,
696702
height: containerSize.height,
697703
overflow: 'hidden',

0 commit comments

Comments
 (0)