Skip to content
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

Bug: after press Shift, mouse cannot move the pane anymore but drawing selection zone instead #641

Closed
buitrung opened this issue Oct 29, 2020 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@buitrung
Copy link

After press or hold Shift button, left mouse click will draw the selection zone.
I cannot move the pane around anymore and have to refresh page.

@chrtze
Copy link
Member

chrtze commented Oct 29, 2020

hi, it is intended that while holding the shift button the selection gets drawn. you can disable this by setting elementsSelectable={false}. see also: https://reactflow.dev/examples/interaction/

from reading your comment I assume the selection still gets drawn when you already released the shift key. this might be happening because you unfocused the react-flow pane while drawing a selection. maybe this can be fixed by resetting the selection on mouseout / blur of the renderer.

@chrtze chrtze closed this as completed Oct 29, 2020
@chrtze chrtze reopened this Oct 29, 2020
@buitrung
Copy link
Author

Hi @chrtze,

hi, it is intended that while holding the shift button the selection gets drawn. you can disable this by setting elementsSelectable={false}. see also: https://reactflow.dev/examples/interaction/

I understand it's the intention to draw the selection zone when holding Shift because that's pretty much a popular behavior, but releasing Shift doesn't returns what I can do sooner so I consider this is a bug. Even in your example link, after pressing Shift, I can neither move the pane or move nodes or click on elements to select, but can only draw selection zone (surely I have toggle all the checkboxes on).

from reading your comment I assume the selection still gets drawn when you already released the shift key. this might be happening because you unfocused the react-flow pane while drawing a selection. maybe this can be fixed by resetting the selection on mouseout / blur of the renderer.

Can you provide the code sample? I don't see anything related in the docs.

@buitrung
Copy link
Author

Plus, after press Shift, I click on a node to select it, then I click on the pane, the console shows this error:

Warning: `NaN` is an invalid value for the `width` css style property.
    in div (created by NodesSelection)
    in DraggableCore (created by Draggable)
    in Draggable (created by NodesSelection)
    in div (created by NodesSelection)
    in NodesSelection (created by GraphView)
    in div (created by GraphView)
    in GraphView (created by ReactFlow)
    in StoreProvider (created by ReactFlowWrapper)
    in ReactFlowWrapper (created by ReactFlow)
    in div (created by ReactFlow)
    in ReactFlow (created by FlowEditor)

@chrtze chrtze added the bug Something isn't working label Nov 2, 2020
@chrtze chrtze self-assigned this Nov 2, 2020
@moklick
Copy link
Member

moklick commented Nov 5, 2020

The commit above fixes the NaN warning. The other problem still exists.

@chrtze
Copy link
Member

chrtze commented Nov 10, 2020

hi @buitrung, could you check if it works with the next version, we now reset the key state when the window loses focus.

npm i react-flow-renderer@next

@chrtze chrtze closed this as completed Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants