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
Add support for disabling JupyterLab's context menu #7877
Add support for disabling JupyterLab's context menu #7877
Conversation
Fixes jupyterlab#7670 by disabling JuptyrLab's context menu on all elements which are children of elements with the `data-native-context-menu` property.
Thanks for making a pull request to JupyterLab! To try out this branch on binder, follow this link: |
How does the name here compare with the name for disabling keyboard shortcuts? Should we namespace it to JupyterLab, since data attributes are a global namespace? |
Great questions. @afshin can you point me to the keyboard shortcut code? I found jupyterlab/jupyterlab-shortcutui#50 but not sure where the magic EDIT: Found it |
This now matches lumino keyboard shortcuts disable data attribute
@jasongrout I changed to |
Thanks, that's more descriptive and conservative to me. |
Co-Authored-By: Jason Grout <jasongrout@users.noreply.github.com>
Co-Authored-By: Jason Grout <jasongrout@users.noreply.github.com>
I think you need to use
|
@blink1073 Thank you for catching this! Maybe I should actually start paying attention to when our docs fail to build :D |
It looks like the lexer still can't handle the block, perhaps because of the |
test |
The docs are failing, but I believe just from a response from the Github API when checking the links:
Otherwise, this is good to go. Any blockers on merging this? |
Thanks @vidartf for merging. Since this is in master, does it mean it will be released in a 2.0.1 instead of having to wait for 3.0.0? |
This isn't really a bugfix. You're not the first person to ask about having something released before 3.0, though. Perhaps the community would really rather have a 2.1 at some point before June, rather than another week of work on 3.0? |
Yeah. I remember having a conversation about this before 2.0 went out and the sentiment was "Lets not block on this for 2.0, we will have a minor release very shortly after and it can go in that since it isn't breaking." That is what I communicated to others as well. I can commit to being the "release coordinator" (or whatever term we wanna call it) for 2.1.0, making sure all the necessary things are done, if that would be helpful. I don't wanna just push more work on you! |
Thanks. Our thoughts in the 3.0 planning meeting was that 3.0 is not a really long time away, so let's not stop work on 3.0 to ship 2.1. But if we can scale out the release managers, that's another way to ease the burden. Let's take this up over on #8038 to decide a good time for a 2.1 release. |
Fixes #7670 by disabling JuptyrLab's context menu on all elements which
are children of elements with the
data-jp-suppress-context-menu
property.data-native-context-menu
I tested this out by modifying the JSON renderer to disable the context menu:
References
#7670
Code changes
Checks if the
data-native-context-menu
property is on a node, when you right click on it,or any of its parents. If so, disables JupyterLab's default context menu and lets anyone else handle the vent as they would like.
User-facing changes
None.
Backwards-incompatible changes
Any elements that already happen have the
data-native-context-menu
attribute will not show the JupyterLab context menu when you click on them.