fix(ui): portal menus to body above the sidedocks
This commit is contained in:
1 parent
8a609da778
commit
0873cbb366
2 files changed
+23
-3
No files matched your search
+12
-3
@@ -18,14 +18,23 @@
|
||||
|
||||
let { app, store, settings, component }: Props = $props();
|
||||
|
||||
let root = $state<HTMLElement | null>(null);
|
||||
// Menus hang off body, not off the view: Obsidian's sidedocks paint above the
|
||||
// leaf, so anything portalled inside it is covered once it crosses a pane edge.
|
||||
// The layer carries .bcal-root so the theme aliases still reach the popovers.
|
||||
const layer = document.createElement("div");
|
||||
layer.className = "bcal-root bcal-portal";
|
||||
|
||||
$effect(() => {
|
||||
document.body.append(layer);
|
||||
return () => layer.remove();
|
||||
});
|
||||
|
||||
provideView({
|
||||
app,
|
||||
store,
|
||||
settings,
|
||||
component,
|
||||
portal: () => root as HTMLElement,
|
||||
portal: () => layer,
|
||||
});
|
||||
|
||||
let creating = $state(false);
|
||||
@@ -56,7 +65,7 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div bind:this={root} class="bcal-root">
|
||||
<div class="bcal-root">
|
||||
<div class="bcal-app">
|
||||
{#if !store.railCollapsed}
|
||||
<SphereRail />
|
||||
|
||||
Reference in new issue
Block a user