-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Drag selection is dropped when mouse is outside the pane or when mouse encounters outside elements #4203
Comments
This problem originates from <div
className={cc(['react-flow__pane', { draggable: panOnDrag, dragging, selection: isSelecting }])}
onClick={hasActiveSelection ? undefined : wrapHandler(onClick, container)}
onContextMenu={wrapHandler(onContextMenu, container)}
onWheel={wrapHandler(onWheel, container)}
onMouseEnter={hasActiveSelection ? undefined : onPaneMouseEnter}
onMouseDown={hasActiveSelection ? onMouseDown : undefined}
onMouseMove={hasActiveSelection ? onMouseMove : onPaneMouseMove}
onMouseUp={hasActiveSelection ? onMouseUp : undefined}
onMouseLeave={hasActiveSelection ? onMouseLeave : onPaneMouseLeave}
ref={container}
style={containerStyle}
>
{children}
<UserSelection />
</div> Once the mouse exits the pane, the onMouseLeave event triggers, ending the selection process. Is there any rationale for not subscribing to the global 'onMouseMove' and 'onMouseUp' events? Additionally, we could consider temporarily disabling text selection globally during the selection process. What do you think? |
I can't think of a reason for not subscribing to the global 'onMouseMove' and 'onMouseUp' events. And yes, I would prefer that text selection is disabled globally during selection. |
Describe the Bug
When using drag select, selection is drag selection is immediately dropped when mouse is outside the pane or when mouse encounters outside elements, even when mouse button has not been released. This makes drag selection unusable if I want to place something in the middle of the pane.
Your Example Website or App
https://codesandbox.io/p/sandbox/suspicious-pond-cxypq3?file=%2FApp.js%3A76%2C34
Steps to Reproduce the Bug or Issue
Expected behavior
Drag selection persists even when mouse is outside the pane or when mouse encounters outside elements
Screenshots or Videos
Screen.Recording.2024-04-24.at.17.27.55.mov
Platform
Additional context
No response
The text was updated successfully, but these errors were encountered: