mirror of
https://github.com/MrPatben8/konduktor.git
synced 2026-11-27 10:22:51 +01:00
Fixed overlay windows rendering below other UI
This commit is contained in:
1 parent
2810f24563
commit
be80e572e5
16 files changed
+104
-65
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import { createPortal } from 'react-dom'
|
||||
import type { ReactNode } from 'react'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { Icon } from '../lib/icons'
|
||||
@@ -55,7 +56,7 @@ export function ContextMenu({ x, y, items, onClose }: Props) {
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
return createPortal(
|
||||
// `contents`: the panels are fixed-positioned, so this wrapper must take no
|
||||
// part in layout. As an ordinary empty block it became one more item in
|
||||
// the app's gapped flex column and pushed every panel down by a gap.
|
||||
@@ -69,7 +70,8 @@ export function ContextMenu({ x, y, items, onClose }: Props) {
|
||||
return { top, left: Math.min(x, window.innerWidth - 180), maxHeight: window.innerHeight - top - 8 }
|
||||
})()}
|
||||
/>
|
||||
</div>
|
||||
</div>,
|
||||
document.body,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -101,7 +103,7 @@ function MenuPanel({
|
||||
return (
|
||||
<>
|
||||
<div
|
||||
className={`glass-overlay fixed z-50 overflow-y-auto rounded-2xl p-1.5 ${className}`}
|
||||
className={`glass-overlay fixed z-[70] overflow-y-auto rounded-2xl p-1.5 ${className}`}
|
||||
style={style}
|
||||
>
|
||||
{items.map((item, i) => {
|
||||
|
||||
Reference in new issue
Block a user