Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix[dialogs]: portal-scope and clickoutside behavior on dialogs (#1692)

Peter Chinman681f8246b986
diff --git a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
index 4297c44695..65c71c5d77 100644
--- a/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
+++ b/js/app/packages/app/component/split-layout/components/PopoverSplitRenderer.tsx
@@ -125,24 +125,20 @@ function PopoverSplitModal(props: {
}}
modal={true}
>
- <Dialog.Overlay class="fixed inset-0 z-modal-overlay bg-transparent" />
- <div class={`fixed inset-0 z-modal flex pointer-events-none isolate`}>
- <DialogWrapper
- contentRef={(r) => {
- setPanelRef(r);
- clickOutside(r, () => () => props.onClose());
- bindHotKeyDom(r);
- }}
- >
- <SplitPanelContext.Provider value={stubPanelContext}>
- <SoupContextProvider>
- <Show when={props.popover.mount}>
- <Dynamic component={props.popover.mount.element} />
- </Show>
- </SoupContextProvider>
- </SplitPanelContext.Provider>
- </DialogWrapper>
- </div>
+ <DialogWrapper
+ contentRef={(r) => {
+ setPanelRef(r);
+ bindHotKeyDom(r);
+ }}
+ >
+ <SplitPanelContext.Provider value={stubPanelContext}>
+ <SoupContextProvider>
+ <Show when={props.popover.mount}>
+ <Dynamic component={props.popover.mount.element} />
+ </Show>
+ </SoupContextProvider>
+ </SplitPanelContext.Provider>
+ </DialogWrapper>
</Dialog>
);
}
diff --git a/js/app/packages/core/component/DialogWrapper.tsx b/js/app/packages/core/component/DialogWrapper.tsx
index c8f730eb48..3b1904274b 100644
--- a/js/app/packages/core/component/DialogWrapper.tsx
+++ b/js/app/packages/core/component/DialogWrapper.tsx
@@ -28,21 +28,21 @@ export function DialogWrapper(props: DialogWrapperProps) {
ref={props.overlayRef}
/>
<div class="z-modal fixed inset-0">
- <div
+ <Dialog.Content
class={cn(
- 'max-w-[calc(100vw-16px)] mt-20 sm:mt-40 mx-auto overflow-hidden'
+ 'max-w-[calc(100vw-16px)] mt-20 sm:mt-40 mx-auto overflow-hidden portal-scope'
)}
style={{ width: width }}
>
<ClippedPanel tl active>
- <Dialog.Content
+ <div
class={cn('[&>*]:max-h-[75vh]', props.class)}
ref={props.contentRef}
>
{props.children}
- </Dialog.Content>
+ </div>
</ClippedPanel>
- </div>
+ </Dialog.Content>
</div>
</>
// Overlay with Diagonal pattern