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

in Dialog or Modal the drag maybe cause position offset #28

Open
0xbul1 opened this issue Jan 19, 2022 · 6 comments
Open

in Dialog or Modal the drag maybe cause position offset #28

0xbul1 opened this issue Jan 19, 2022 · 6 comments
Labels
enhancement New feature or request fix-applied

Comments

@0xbul1
Copy link

0xbul1 commented Jan 19, 2022

Hi @amendx

First, its awesome repo thanks a lot.

But i Found a problem in some need

look my picture
7yMCIH.png

the count 1 is my cursor true position
the count 2 is the drag baby position

the positon has offset

this is demo link

i found a repo like your repo vueSlicksort
the vueSlicksort provide a appendto props in his SlickList Component like you Container Component
how can i solve the offset question?

thanks again.

@amendx amendx added the enhancement New feature or request label Jan 20, 2022
@freegns
Copy link

freegns commented Jan 27, 2022

@amendx Excelente contribución, en el futuro seria interesante una versión para angular.

@amendx
Copy link
Owner

amendx commented Feb 1, 2022

@0xbul1 I've made some changes inside your demo link using :get-ghost-parent="getGhostParent":

getGhostParent() {
      const element = document.querySelector('#dialog').children.item(1);
      return element.children.item(0);
    },
  • I tried to just simulate what you could do in this case, since the getGhostParent does pretty much the exact same thing as you wondered about the appendTo. The issue in the example was the positioning of the dialog, wich could be causing the draggable element to get positioned "outside" the targeted container. Try that out on your project and see if that still happens.

@0xbul1
Copy link
Author

0xbul1 commented Feb 1, 2022

Hi @amendx, Sorry for the late reply.

emmm, sorry its my fault.
Perhaps the position offset is not caused by appendtoprops?

I change the demo and in my before project i do like this.
and the SlickSortproject will be no position offset.

so now i change the same code use vue-dndrop.
but vue-dndrop still have position offset like this video
you can confirm use Open in New Window LIVE in the demo link page or click there directly ( must do this watch example in big screen, You will find the same problem as in my video)

@phislop-sra
Copy link

I've encountered this problem as well, and I've made a bit of progress on finding the cause. It appears to stem from any use of a transform style on a parent of the drag container. I've made a more minimal example with scale(0), which has no impact on the display but still messes up the tracking on the ghost item.

@amendx
Copy link
Owner

amendx commented Apr 28, 2022

@phislop-sra Nice! I'll take a look at it. I'm repairing some code to fit other issues as well. Hope I'll find your solution!

@thebleucheese
Copy link

Note that adding transform: unset style to the dialog or overlay component will generally resolve this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fix-applied
Projects
None yet
Development

No branches or pull requests

5 participants