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

Issue with drag shadow #257

Open
mayank-ms088 opened this issue Jun 12, 2021 · 7 comments
Open

Issue with drag shadow #257

mayank-ms088 opened this issue Jun 12, 2021 · 7 comments

Comments

@mayank-ms088
Copy link

mayank-ms088 commented Jun 12, 2021

I have cloned the repo and run the landing example. And this is dragging the user components like in the video.
Can anyone help me to sort this out?
I want to use this library in my project.

OS: ubuntu 20.04 LTS

see the video

Screencast.from.12-06-21.08_32_56.AM.IST.mp4
@prevwong prevwong changed the title GETTING ERROR IN DRAGGING THE USER COMPONENT IN LANDING EXAMPLE Issue with drag shadow Jun 12, 2021
@prevwong
Copy link
Owner

Can't reproduce on my machine, might be OS related perhaps. @ankri @matdru Any ideas? 🤔

@mayank-ms088
Copy link
Author

mayank-ms088 commented Jun 14, 2021

YES I have checked it.

  • It is Working Correctly on Mac OS.

  • In Windows Drag shadow is not there but while dragging, the component is not at the cursor position. It is dragging from some other position. (SEE THE ATTACHED SS)

  • In Linux As I have mentioned above, having an error with drag shadow.

SS-1

SS-2

@mayank-ms088
Copy link
Author

Can anyone help me to sort this please?

@iojcde
Copy link

iojcde commented Jun 21, 2021

Having the same issue here.

I see no shadow for craft.js.org, but I can confirm that there is a shadow when I run it locally (even in production). I also running a Linux distribution (Arch btw). There is a white translucent background for every component when you drag them.

Really weird because craft.js.org should work exactly the same as when you run it locally in production..

@laofaKB
Copy link

laofaKB commented Jul 2, 2021

Having same issue as @JcdeA

on ubuntu20.04,
https://craft.js.org/examples/basic/ works properly
run locally, chrome and firefox both have shadows when drag,
and on firefox further, the component is not at the cursor position

@ankri
Copy link
Collaborator

ankri commented Jul 2, 2021

Sadly this is an issue with Chrome that has been open for 6 years now 😔

A suggested solution would be to not render the container which has width: 100% and height: 100% but render only the shadow itself.

Beware that in the next branch we have support for multi-select.

@zwg-zero
Copy link

change the container to

e.dataTransfer.setDragImage(shadow, 0, 0);

fix the problem on ubuntu20.4, not tested on other systems and not sure how much impact on other scenes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants