Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ const Popper: React.FC<PopperProps> = ({
returnFocus,
}) => {
const controlled = typeof open === 'boolean';
const openProp = controlled ? open : true;
const openProp = controlled ? open || false : true;
const nodeRef = React.useRef<Element>();
const popperRef = React.useRef<PopperJS>(null);
const popperRefs = useCombineRefs<PopperJS>(popperRef, popperRefIn);
const [isOpen, setOpenState] = React.useState(openProp);
const focusRef = React.useRef<Element>();
const focusRef = React.useRef<Element | null>();
const onRequestCloseRef = React.useRef(onRequestClose);
onRequestCloseRef.current = onRequestClose;

Expand Down
5 changes: 2 additions & 3 deletions frontend/packages/topology/src/components/GraphComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { Graph } from '../types';
import { WithPanZoomProps } from '../behavior/usePanZoom';
import { WithDndDropProps } from '../behavior/useDndDrop';
import { WithSelectionProps } from '../behavior/useSelection';
import useCombineRefs from '../utils/useCombineRefs';
import { WithContextMenuProps } from '../behavior/withContextMenu';
import LayersProvider from './layers/LayersProvider';
import { DEFAULT_LAYER } from './layers/LayersContext';
Expand Down Expand Up @@ -50,7 +49,6 @@ const GraphComponent: React.FC<GraphComponentProps> = ({
onContextMenu,
}) => {
const layout = element.getLayout();
const refs = useCombineRefs<SVGPathElement>(panZoomRef, dndDropRef);
React.useEffect(() => {
element.layout();
// Only re-run if the layout changes
Expand All @@ -61,6 +59,7 @@ const GraphComponent: React.FC<GraphComponentProps> = ({
return (
<>
<rect
ref={dndDropRef}
x={0}
y={0}
width={bounds.width}
Expand All @@ -71,7 +70,7 @@ const GraphComponent: React.FC<GraphComponentProps> = ({
/>
<g
data-surface="true"
ref={refs}
ref={panZoomRef}
transform={`translate(${bounds.x}, ${bounds.y}) scale(${element.getScale()})`}
>
<Inner element={element} />
Expand Down