mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 21:01:08 +02:00
fix(ui): allow multiple detail views open across AppPages
Previously, clicking a detail view in one AppPage would close the overlay in all other AppPages because the global click handler closed on ANY click outside the overlay card. Now the click handler only closes the overlay when the click is inside the SAME AppPage but outside the overlay card. Clicks in other AppPages are ignored, allowing multiple detail views to be open simultaneously side by side. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
df74029423
commit
a8480f6710
1 changed files with 11 additions and 2 deletions
|
|
@ -216,12 +216,20 @@
|
|||
}
|
||||
|
||||
let overlayCardEl = $state<HTMLDivElement | null>(null);
|
||||
let appPageEl = $state<HTMLDivElement | null>(null);
|
||||
|
||||
// Close overlay on any click outside the overlay card
|
||||
// Close overlay on click outside the overlay card BUT inside this AppPage
|
||||
// (clicks in other AppPages should NOT close this overlay)
|
||||
$effect(() => {
|
||||
if (!overlay) return;
|
||||
function handleGlobalClick(e: MouseEvent) {
|
||||
if (overlayCardEl && !overlayCardEl.contains(e.target as Node)) {
|
||||
const target = e.target as Node;
|
||||
if (
|
||||
overlayCardEl &&
|
||||
appPageEl &&
|
||||
appPageEl.contains(target) &&
|
||||
!overlayCardEl.contains(target)
|
||||
) {
|
||||
overlayStack = [];
|
||||
siblingIds = [];
|
||||
siblingKey = '';
|
||||
|
|
@ -238,6 +246,7 @@
|
|||
</script>
|
||||
|
||||
<div
|
||||
bind:this={appPageEl}
|
||||
class="app-page-wrapper"
|
||||
use:dropTarget={{
|
||||
accepts: acceptedDropTypes,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue