jupyterlab / lumino

Lumino is a library for building interactive web applications
https://lumino.readthedocs.io/
Other
635 stars 126 forks source link

Drag image is rendered off-screen #593

Closed MetRonnie closed 1 year ago

MetRonnie commented 1 year ago

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

I think this was introduced in #502 which replaced https://github.com/jupyterlab/lumino/blob/578b0a3dfc40ff585dc8ce559c8fb75214a8d4ab/packages/dragdrop/src/index.ts#L234-L235

with https://github.com/jupyterlab/lumino/blob/60060576f0ded96fb2f6d9d3c46cc9f9ca5dd080/packages/dragdrop/src/index.ts#L234

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.

welcome[bot] commented 1 year ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
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! :wave:
Welcome to the Jupyter community! :tada:

fcollonval commented 1 year ago

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 commented 1 year ago

PR up at #595