Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
var originalModel = monaco.editor.createModel(
'This line is removed on the right.\njust some text\nabcd\nefgh\nSome more text',
'text/plain'
);
var modifiedModel = monaco.editor.createModel(
'just some text\nabcz\nzzzzefgh\nSome more text\nThis line is removed on the left.',
'text/plain'
);
var diffEditor = monaco.editor.createDiffEditor(document.getElementById('container'), {
// You can optionally disable the resizing
enableSplitViewResizing: false,
// Render the diff inline
renderSideBySide: false
});
diffEditor.setModel({
original: originalModel,
modified: modifiedModel
});
Reproduction Steps
Click on the lightbulb icon in the editor playground. https://microsoft.github.io/monaco-editor/playground.html#creating-the-diffeditor-inline-diff-example
Actual (Problematic) Behavior
I see a console error:
dom.ts:462 Uncaught TypeError: Cannot read properties of null (reading 'getBoundingClientRect')
at Object.O [as getDomNodePagePosition] (dom.ts:462:21)
at u.doLayout (contextview.ts:324:33)
at u.show (contextview.ts:220:8)
at Ve.showContextView (contextViewService.ts:52:20)
at Ve.showContextView (standaloneServices.ts:687:16)
at u.showContextMenu (contextMenuHandler.ts:53:27)
at tt.showContextMenu (contextMenuService.ts:45:27)
at _ (inlineDiffMargin.ts:148:29)
at inlineDiffMargin.ts:173:4
at HTMLDivElement.<anonymous> (dom.ts:81:10)
Expected Behavior
The context menu would pop open
Additional Context
I can also reproduce this on a minimal creation of the code editor in React and Vite.
Reproducible in vscode.dev or in VS Code Desktop?
Reproducible in the monaco editor playground?
Monaco Editor Playground Code
Reproduction Steps
Click on the lightbulb icon in the editor playground. https://microsoft.github.io/monaco-editor/playground.html#creating-the-diffeditor-inline-diff-example
Actual (Problematic) Behavior
I see a console error:
Expected Behavior
The context menu would pop open
Additional Context
I can also reproduce this on a minimal creation of the code editor in React and Vite.