File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/vscode-integration-webview/src Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 14
14
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
15
15
********************************************************************************/
16
16
17
- import { ModuleConfiguration } from '@eclipse-glsp/client' ;
17
+ import { ModuleConfiguration , contextMenuModule } from '@eclipse-glsp/client' ;
18
18
import { vscodeCopyPasteModule } from './features/copyPaste/copy-paste-module' ;
19
19
import { vscodeDefaultModule } from './features/default/default-module' ;
20
20
import { vscodeExportModule } from './features/export/export-module' ;
@@ -30,5 +30,6 @@ export const VSCODE_DEFAULT_MODULES = [
30
30
] as const ;
31
31
32
32
export const VSCODE_DEFAULT_MODULE_CONFIG : ModuleConfiguration = {
33
- add : [ ...VSCODE_DEFAULT_MODULES ]
33
+ add : [ ...VSCODE_DEFAULT_MODULES ] ,
34
+ remove : [ contextMenuModule ]
34
35
} ;
Original file line number Diff line number Diff line change @@ -73,9 +73,17 @@ export abstract class GLSPDiagramWidget {
73
73
containerDiv . addEventListener ( 'mouseleave' , e => this . handleMouseLeave ( e ) ) ;
74
74
window . addEventListener ( 'focus' , e => this . handleFocusChange ( e , true ) ) ;
75
75
window . addEventListener ( 'blur' , e => this . handleFocusChange ( e , false ) ) ;
76
+ window . addEventListener ( 'contextmenu' , e => this . handleContextMenu ( e ) ) ;
76
77
}
77
78
}
78
79
80
+ handleContextMenu ( e : MouseEvent ) : void {
81
+ // Prevent the default context menu for now
82
+ // Should be removed once we provide a proper context menu integration
83
+ e . preventDefault ( ) ;
84
+ window . focus ( ) ;
85
+ }
86
+
79
87
handleMouseEnter ( e : MouseEvent ) : void {
80
88
this . containerDiv ?. classList . add ( 'mouse-enter' ) ;
81
89
this . containerDiv ?. classList . remove ( 'mouse-leave' ) ;
You can’t perform that action at this time.
0 commit comments