You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
React-beautiful-dnd binds event listeners to current browser window that has the draggable component.
For comparison both react-sortable-hoc and react-dnd do not always directly bind to the global window object.
Actual behaviour
I am using a package called react-popout with react-beautiful-dnd. This library allows react elements to be "popped out" of the current browser window by opening another browser window. As react-beautiful-dnd binds its event listeners to the global window object, the cursor is bound to the wrong window. (see demo)
Steps to reproduce
Enclose a react-beautiful-dnd list in a PopoutWindow component (imported from react-popout). Attempt to drag draggables in the list.
Notice how in the popout window, items will only drag when the cursor is in the original window.
How to Fix
The fix for this is quite easy, in the drag-handle.jsx file use the draggableRef prop to get access to the actual window that the draggable is rendered on.
Hey @kgorgi thanks for raising this :) We'd be happy to accept a PR for this if you'd like to submit one. Otherwise this is something we're aiming to look at next week.
Bug or feature request?
Bug
Expected behaviour
React-beautiful-dnd binds event listeners to current browser window that has the draggable component.
For comparison both react-sortable-hoc and react-dnd do not always directly bind to the global window object.
Actual behaviour
I am using a package called react-popout with react-beautiful-dnd. This library allows react elements to be "popped out" of the current browser window by opening another browser window. As react-beautiful-dnd binds its event listeners to the global window object, the cursor is bound to the wrong window. (see demo)
Steps to reproduce
Enclose a react-beautiful-dnd list in a PopoutWindow component (imported from react-popout). Attempt to drag draggables in the list.
Browser version
Version 61.0.3163.100 (Official Build) (64-bit)
Demo
https://drive.google.com/open?id=0B4Bi-ARyjM_hT1dFaE9ueHVOQVU
Notice how in the popout window, items will only drag when the cursor is in the original window.
How to Fix
The fix for this is quite easy, in the drag-handle.jsx file use the draggableRef prop to get access to the actual window that the draggable is rendered on.
Original Code:
react-beautiful-dnd/src/view/drag-handle/drag-handle.jsx
Line 508 in e419cdb
Suggested Fix:
The text was updated successfully, but these errors were encountered: