jupyterlab / lumino

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

Fix position of drag image #595

Closed MetRonnie closed 1 year ago

MetRonnie commented 1 year ago

Closes #593

I tried using transform-origin but that didn't work.

Note I've only tested this in my web app using Lumino but not a minimal example.

welcome[bot] commented 1 year ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly. welcome You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

fcollonval commented 1 year ago

Thanks @MetRonnie

I took the liberty to push a commit on top of your PR to set the exact offset position of the cursor. What do you think?

@krassowski do you have time to review this one as it may impact CSS styling performance?

krassowski commented 1 year ago

I think the proposed solution would be fine performance-wise as it only modifies position once when creating the drag node. I would recommend merging and once a new release is out I can run benchmarks to ensure there is no regressions and investigate manually if needed.

MetRonnie commented 1 year ago

@fcollonval Nice 👍

fcollonval commented 1 year ago

Thanks both - so I'm merging as is.

welcome[bot] commented 1 year ago

Congrats on your first merged pull request in this project! :tada: congrats Thank you for contributing, we are very proud of you! :heart: