-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Preventing context menu in jupyter-widget output #3521
Comments
(note, in the example code |
This is not fixed, or the fix has been regressed, using Version 0.35.4 |
I have the same problem on my jupyterlab 0.35.6 |
@vidartf I'm using my own html and WebGL components, but in general anywhere I click in the output cell has the jupyterlab context menu, even controls that have focus.
Execute above and try right clicking on the produced input field, it should show the default browser context menu. I can put together an example using a WebGL component if that helps. I would say there's a lot to be said for not having the custom context menu appear for output cells at all. For example: if an image is produced you can't use the browser features for saving or copying the image (well you can still get it with shift, but not everyone will be aware of that). I have since worked around it where it matters in my code by calling stopPropogation() in the contextmenu event for my components. |
We've added an item to the context menu telling people about the shift-click to get to the native menu. |
@jasongrout @vidartf thank you for your help. I probably should check even more, but until now, I still can't see my right-click menus (from francy-widget) on jupyterlab -- although I see them very well on the notebook.
|
The last PR I can find that touched that code is #3554. @blink1073 / @ellisonbg / @jasongrout you were the most involved in that PR, and I'm struggling to follow the rather long discussions and big code changes. Was this an intended reversion, or a regression? |
Yes, that PR switches us to using the capture phase for the context menu, which simplified our selector logic across the board. We added instructions for extension authors here. Current docs link: https://github.com/jupyterlab/jupyterlab/blob/master/docs/source/developer/extension_dev.rst#context-menus |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related discussion. |
I was playing around with pythreejs today in jupyterlab (it creates a WebGL context as its widget view), and I noticed that when I pan the scene by dragging with the right-click mouse button, I always get the context menu when I release the button.
The drag handler in question registers for several events, among others doing this:
What is the right way to prevent the context menu from showing in this case? I'd prefer it to show up for other cases (e.g. when these controls are not enabled).
The text was updated successfully, but these errors were encountered: