chore(react): dont use position fixed

This commit is contained in:
moklick
2024-03-07 13:41:46 +01:00
parent 305be1e26a
commit fd2e131a9c
+2 -7
View File
@@ -2,7 +2,7 @@
* The user selection rectangle gets displayed when a user drags the mouse while pressing shift * The user selection rectangle gets displayed when a user drags the mouse while pressing shift
*/ */
import { CSSProperties, useRef, type MouseEvent as ReactMouseEvent, type ReactNode } from 'react'; import { useRef, type MouseEvent as ReactMouseEvent, type ReactNode } from 'react';
import { shallow } from 'zustand/shallow'; import { shallow } from 'zustand/shallow';
import cc from 'classcat'; import cc from 'classcat';
import { getNodesInside, getEventPosition, SelectionMode } from '@xyflow/system'; import { getNodesInside, getEventPosition, SelectionMode } from '@xyflow/system';
@@ -13,11 +13,6 @@ import { useStore, useStoreApi } from '../../hooks/useStore';
import { getSelectionChanges } from '../../utils'; import { getSelectionChanges } from '../../utils';
import type { ReactFlowProps, ReactFlowState, NodeChange, EdgeChange } from '../../types'; import type { ReactFlowProps, ReactFlowState, NodeChange, EdgeChange } from '../../types';
export const paneStyle: CSSProperties = {
...containerStyle,
position: 'fixed',
};
type PaneProps = { type PaneProps = {
isSelecting: boolean; isSelecting: boolean;
children: ReactNode; children: ReactNode;
@@ -232,7 +227,7 @@ export function Pane({
onMouseUp={hasActiveSelection ? onMouseUp : undefined} onMouseUp={hasActiveSelection ? onMouseUp : undefined}
onMouseLeave={hasActiveSelection ? onMouseLeave : onPaneMouseLeave} onMouseLeave={hasActiveSelection ? onMouseLeave : onPaneMouseLeave}
ref={container} ref={container}
style={paneStyle} style={containerStyle}
> >
{children} {children}
<UserSelection /> <UserSelection />