chore(react): dont use position fixed
This commit is contained in:
@@ -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 />
|
||||||
|
|||||||
Reference in New Issue
Block a user