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';
4
4
5
5
import { CommandRegistry } from '@lumino/commands' ;
6
6
7
- import { Menu } from '@lumino/widgets' ;
7
+ import { Menu , Widget } from '@lumino/widgets' ;
8
8
9
9
/**
10
10
* An object which provides context menus for the data grid.
@@ -207,6 +207,15 @@ export class FeatherGridContextMenu extends GridContextMenu {
207
207
208
208
// Open context menu at location of the click event
209
209
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
+ }
210
219
}
211
220
}
212
221
You can’t perform that action at this time.
0 commit comments