-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Dragged element seems to be positioned in relation to wrong point #703
Comments
Same problem here. I have a sidebar with transfrom: translateX(120px) + 15px padding-left and when start dragging, the component calculate this as left position, but ignore that it is already in relative position container, so the display position of 135px is wrong. |
Have you tried using a portal? |
If you have animations is bad idea to do it with position and your performance will drop a lot. I have to keep transform for my animations...
Can't use react portal, because i have more than 200 items in the list :( I patch it by forcing dragging element left position to 15px with |
@alexreardon - you are right. Using Portal helped a lot. I have updated my code sandbox with it. Thank you for the assistance 👍 |
OK, that worked fine for desktop, but now it looks like moving items on mobile (touch device) don't work. You can see in the demo https://wwm3727x5.codesandbox.io/ with mobile version open. Do you think it is the same as #582 ? Because it seems to be, since I am using Portal as well. |
Yes, it is an issue with portals. We are investigating a work around for users of portals |
Bug or feature request?
Bug
Expected behavior
When dragged, element should be visible and (probably) calculated in relation to the viewport or element it is inside of.
Actual behavior
I am using react-swipeable-views and when I put
DragDropContext
into the second view, dragged component is not being displayed properly. At first it looks as if it doesn't display at all or is hidden behind some elements, but I was able to find that it is being dragged on the first tab instead. Just as if it would use wrong relative location for dragging.This may as well be a problem with
react-swipeable-views
, but since it is drag&drop item disappearing, I think it would be good to solve it in here.Steps to reproduce
I have it reproduced in code on Codesandbox. As you can see, I am using the simple example for horizontal drag&drop and basic use of swipeable view.
To see the element comming from the left panel:
What version of
React
are you using?16.4.1
What version of
react-beautiful-dnd
are you running?9.0.0
What browser are you using?
Google Chrome 67.0.3396.99
Demo
https://codesandbox.io/s/wwm3727x5
If needed I can provide video of the behaviour but AFAIK this is happening on all platforms.
The text was updated successfully, but these errors were encountered: