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

Change the Drag class's private method _moveDragImage to a public method moveDragImage. #96

Merged
merged 2 commits into from Jul 27, 2020

Conversation

ghost
Copy link

@ghost ghost commented Jul 23, 2020

Hi, my name is Logan McNichols. I am an intern for Jupyter Cal Poly. I am working on a tabular data editor powered by the datagrid along with @kgoo124 and @ryuntalan.

We would like to use lumino's Drag class to create a column/row shadow which appears on a mouse click of a column/row header and is drag-able. The movement of this shadow can't just follow the cursor wherever it goes, but must be constrained to the bounds of the DataGrid. This PR would allow us to do this, by letting us extend Drag and make modifications to moveDragImage.

This PR would rename _moveDragImage to moveDragImage and update it's implementations to reflect this change. It would remove the private access modifier and relocate moveDragImage to the area where the other public methods are.

fixes #95

@ghost ghost changed the title Change the Drag class's private method _moveDragImage a public method moveDrageImage. Change the Drag class's private method _moveDragImage to a public method moveDrageImage. Jul 23, 2020
@ghost ghost changed the title Change the Drag class's private method _moveDragImage to a public method moveDrageImage. Change the Drag class's private method _moveDragImage to a public method moveDragImage. Jul 23, 2020
@vidartf
Copy link
Member

vidartf commented Jul 24, 2020

If the goal is only to be able to override the method when subclassed, I would say protected is a better middle ground than making it public.

@afshin
Copy link
Member

afshin commented Jul 27, 2020

@lmcnichols Does Vidar's suggestion of making this method protected still satisfy your use case?

@ghost
Copy link
Author

ghost commented Jul 27, 2020

Yes it still does. I added the protected access modifier to moveDragImage

Copy link
Contributor

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@blink1073 blink1073 merged commit e48ad06 into jupyterlab:master Jul 27, 2020
@blink1073
Copy link
Contributor

Released @lumino/datagrid@0.12.0

@ghost
Copy link
Author

ghost commented Aug 21, 2020

Hi @blink1073! I'm running into an issue related to this PR. When I jlpm install @lumino/dragdrop@1.6.4 I get the correct package locally. My local @lumino/dragdrop/dist/index.es6.js is correct. But then when I spin up jupyter lab and look at the same directory I seem to get an older version with _moveDragImage instead of moveDragImage. Drag behavior also reverts to the default behavior w/out the bounds. I was just wondering if off the top of your head you know what's going on. I really appreciate the help!

@blink1073
Copy link
Contributor

I believe it is because JupyterLab itself is using the older version and enforcing it using resolutions, we'd need a release of JupyterLab with the newer versions

@ghost
Copy link
Author

ghost commented Aug 22, 2020

Okay that makes sense. Thanks for the help!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Difficult to extend lumino's Drag class to create custom drag behavior.
4 participants