فهرست منبع

Merge pull request #4720 from ian-r-rose/cell_native_context_menu

Allow native context menu to be shown for notebook cell in Chrome.
Afshin Darian 6 سال پیش
والد
کامیت
4420b1437c
1فایلهای تغییر یافته به همراه6 افزوده شده و 0 حذف شده
  1. 6 0
      packages/notebook/src/widget.ts

+ 6 - 0
packages/notebook/src/widget.ts

@@ -1382,6 +1382,12 @@ class Notebook extends StaticNotebook {
    * Handle `contextmenu` event.
    */
   private _evtContextMenuCapture(event: PointerEvent): void {
+    // Allow the event to propagate un-modified if the user
+    // is holding the shift-key (and probably requesting
+    // the native context menu).
+    if (event.shiftKey) {
+      return;
+    }
     // `event.target` sometimes gives an orphaned node in Firefox 57, which
     // can have `null` anywhere in its parent tree. If we fail to find a
     // cell using `event.target`, try again using a target reconstructed from