React-beautiful-dnd: Draggable jumps off screen when scrolled down on a modal

Created on 6 Jun 2018  路  4Comments  路  Source: atlassian/react-beautiful-dnd

Bug or feature request?

Bug

Expected behavior

Draggable item sticks to cursor when dragging around screen, when in a modal

Actual behavior

Draggable item jumps above cursor, sometimes off page when in a modal

Steps to reproduce

Create a dnd within a modal, then attempt to drag the draggable item

Browser version

Chrome Version 66.0.3359.181

Demo

react-beautiful-dnd-bug

Most helpful comment

Hi @SNicholson99,

Try using a portal.

Please feel free to reopen this issue if it does not work for you. If you do need to reopen this issue if you could please add a standalone example that would be great

All 4 comments

Hi @SNicholson99,

Try using a portal.

Please feel free to reopen this issue if it does not work for you. If you do need to reopen this issue if you could please add a standalone example that would be great

@alexreardon . Thanks you. I tried and successfully.

@tanmynguyen

How did you solve this issue? I cant seem to find where I should put the portal

Hi @snicholson99,

Try using a portal.

Please feel free to reopen this issue if it does not work for you. If you do need to reopen this issue if you could please add a standalone example that would be great

That link no longer works. I'm also trying to figure out drag and drop in a modal and the item goes off the modal when I try and drag no matter how I play around with the position(absolute/relative) of the containers.
I tried wrapping my entire modal like this:
return ReactDOM.createPortal( <ReactModal...
But that didn't seem to fix anything.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

h182032 picture h182032  路  3Comments

alexreardon picture alexreardon  路  3Comments

joshmillgate picture joshmillgate  路  3Comments

alexreardon picture alexreardon  路  3Comments

FutureKode picture FutureKode  路  3Comments