bevacqua / dragula

:ok_hand: Drag and drop so simple it hurts
https://bevacqua.github.io/dragula/
MIT License
21.89k stars 1.97k forks source link

Add option 'ignoreItemOffsetOnMirrorPosition' #657

Closed Metroslim closed 6 months ago

Metroslim commented 3 years ago

When the user drag an item -> the mirror DOM item get positionned relative to the mouse position with OR without correcting it with its offsets.

dcantatore commented 3 years ago

@Metroslim Can you explain this further? Is this in reference to an issue?

Metroslim commented 3 years ago

@dcantatore I didn't look at the issues before doing this PR but it seems that it can answer the issue https://github.com/bevacqua/dragula/issues/616.

If the option is set to true then the mirror DOM will be position on the pointer. To be precise, the left top corner of the mirror DOM will be just under the pointer. To fullfill the need of the related issue you just have to add transform: translate(-50%) to the .gu-mirror css.

If you want I can take some screen capture to demonstrate.

dcantatore commented 3 years ago

@Metroslim - Screen capture would be great. Can you add the css change as well as the information to the readme?

Metroslim commented 3 years ago

Hey, screen capture wasn't that easy (confidential project) but I just push updates on Readme and Examples with the information relative to this new option. I'm not an native english speaker so maybe you will find better way to explain the feature. BTW, I'm using ng2-dragula and if you merge this PR you will have to update the @types so that the DragulaOption will be in sync. Thank for your work !

Metroslim commented 3 years ago

Hi there, I haven't heard from you since two weeks. Did you look at my new commit that include a new section in the example to demonstrate what this new option offer ? (BTW I may be using swivel for handling communication between pages and service worker so thanks again for the gret work !)