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

Drag image is rendered off-screen #593

Closed
MetRonnie opened this issue Jun 12, 2023 · 3 comments · Fixed by #595
Closed

Drag image is rendered off-screen #593

MetRonnie opened this issue Jun 12, 2023 · 3 comments · Fixed by #595
Labels
bug Something isn't working

Comments

@MetRonnie
Copy link
Contributor

Description

Since 2.0.0, the "image" that moves with your mouse when you drag & drop is rendered off-screen instead of under your cursor.

Reproduce

  1. Create a DockPanel with a widget in it
  2. Drag the widget tab around

Expected behavior

An image of the widget's tab moves around with your cursor.

Context

  • Operating System and version: Windows 10
  • Browser and version: Chrome 114.0.5735.110
  • JupyterLab version: N/A
  • @lumino version: 2.0.0

I think this was introduced in #502 which replaced

style.top = `${clientY}px`;
style.left = `${clientX}px`;

with

style.transform = `translate(${clientX}px, ${clientY}px)`;

and now it seems the fixed-position offset is incorrect. Setting

top: 0;
left: 0;

sort of fixes it but the top left of the image is anchored to the cursor rather than where you dragged from.

@MetRonnie MetRonnie added the bug Something isn't working label Jun 12, 2023
@welcome
Copy link

welcome bot commented Jun 12, 2023

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@fcollonval
Copy link
Member

Thanks for reporting!

I guess that setting transform-origin is the way to fix this.

cc @krassowski for input

@MetRonnie would you be willing to open a PR?

@MetRonnie
Copy link
Contributor Author

PR up at #595

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants