|
@@ -125,6 +125,22 @@ right-clicks on a DOM element matching ``.jp-Notebook`` (that is to say, a noteb
|
|
|
The selector can be any valid CSS selector, and may target your own UI elements, or existing ones.
|
|
|
A list of CSS selectors currently used by context menu commands is given in :ref:`css-selectors`.
|
|
|
|
|
|
+If you don't want JupyterLab's custom context menu to appear for your element, because you have
|
|
|
+your own right click behavior that you want to trigger, you can add the `data-jp-suppress-context-menu` data attribute
|
|
|
+to any node to have it and its children not trigger it.
|
|
|
+
|
|
|
+For example, if you are building a custom React element, it would look like this:
|
|
|
+
|
|
|
+.. code::
|
|
|
+
|
|
|
+ function MyElement(props: {}) {
|
|
|
+ return (
|
|
|
+ <div data-jp-suppress-context-menu>
|
|
|
+ <p>Hi</p>
|
|
|
+ <p onContextMenu={() => {console.log("right clicked")}}>There</p>
|
|
|
+ </div>
|
|
|
+ )
|
|
|
+ }
|
|
|
|
|
|
.. _copy_shareable_link:
|
|
|
|