Skip to content

Commit c3a10b3

Browse files
authored
Merge branch 'main' into feat/resize-review-card
2 parents 4ac103d + 1a5e48b commit c3a10b3

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/app/src/components/AppLayout.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ function onLeave(el: Element, done: () => void) {
4949
>
5050
<div
5151
v-if="open"
52-
class="fixed top-0 bottom-0 left-0 overflow-y-auto border-r border-default flex flex-col max-w-full bg-default"
52+
class="fixed top-0 bottom-0 left-0 border-r border-default flex flex-col max-w-full bg-default"
5353
:style="sidebarStyle"
5454
>
55+
<!-- This is needed for the Monaco editor to be able to position the portal correctly -->
56+
<div class="monaco-editor">
57+
<div id="monaco-portal" />
58+
</div>
59+
5560
<AppHeader />
5661

5762
<div class="flex-1 overflow-y-auto relative">

src/app/src/composables/useMonaco.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,20 @@ export function useMonaco(target: Ref<HTMLElement | undefined>, options: UseMona
3535

3636
const colorMode = unref(options.colorMode) || 'dark'
3737

38+
const monacoPortal = (el.getRootNode() as Document)?.getElementById('monaco-portal') || undefined
39+
if (monacoPortal) {
40+
monacoPortal.style.position = 'absolute'
41+
monacoPortal.style.top = el.getClientRects()[0].top + 'px'
42+
}
43+
3844
// Create editor instance (use the custom createEditor wrapper from setupMonaco)
3945
editor.value = monaco.createEditor(el, {
4046
theme: getTheme(colorMode),
4147
lineNumbers: 'off',
4248
readOnly: options.readOnly ?? false,
4349
wordWrap: 'on',
4450
automaticLayout: true,
51+
overflowWidgetsDomNode: monacoPortal,
4552
...options.editorOptions,
4653
})
4754

0 commit comments

Comments
 (0)