File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { DataModel } from '@lumino/datagrid';
44
55import { CommandRegistry } from '@lumino/commands' ;
66
7- import { Menu } from '@lumino/widgets' ;
7+ import { Menu , Widget } from '@lumino/widgets' ;
88
99/**
1010 * An object which provides context menus for the data grid.
@@ -207,6 +207,15 @@ export class FeatherGridContextMenu extends GridContextMenu {
207207
208208 // Open context menu at location of the click event
209209 this . _menu . open ( hit . x , hit . y ) ;
210+
211+ // Issue 422: menu should be first child of document.body not last child to work on all of
212+ // Jupyter Lab, Notebook < 7, NbClassic and Voila. Until this is available in lumino/widgets,
213+ // detach and reattach the menu here.
214+ const bodyFirstChild = document . body . firstElementChild ;
215+ if ( this . _menu . node . parentElement == document . body && bodyFirstChild != this . _menu . node ) {
216+ Widget . detach ( this . _menu ) ;
217+ Widget . attach ( this . _menu , document . body , bodyFirstChild as HTMLElement ) ;
218+ }
210219 }
211220}
212221
You can’t perform that action at this time.
0 commit comments