Skip to content

Commit 105cb63

Browse files
authored
fix(modal): center full-size modals against the viewport instead of the content area (#4984)
1 parent d9f78c0 commit 105cb63

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

  • apps/sim/components/emcn/components/modal

apps/sim/components/emcn/components/modal/modal.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ export interface ModalContentProps
129129
* - lg: max 600px (content-heavy modals)
130130
* - xl: max 800px (complex editors)
131131
* - full: max 1200px (dashboards, large content)
132+
*
133+
* Sizes up to `xl` center within the content area (offset for the sidebar,
134+
* and the panel on workflow pages). `full` modals span most of the viewport,
135+
* so they center against the full viewport instead.
132136
* @default 'md'
133137
*/
134138
size?: ModalSize
@@ -184,11 +188,15 @@ const ModalContent = React.forwardRef<
184188
<ModalOverlay />
185189
<div
186190
className='pointer-events-none fixed inset-0 z-[var(--z-modal)] flex items-center justify-center'
187-
style={{
188-
paddingLeft: isWorkflowPage
189-
? 'calc(var(--sidebar-width) - var(--panel-width))'
190-
: 'var(--sidebar-width)',
191-
}}
191+
style={
192+
size === 'full'
193+
? undefined
194+
: {
195+
paddingLeft: isWorkflowPage
196+
? 'calc(var(--sidebar-width) - var(--panel-width))'
197+
: 'var(--sidebar-width)',
198+
}
199+
}
192200
>
193201
<DialogPrimitive.Content
194202
ref={ref}

0 commit comments

Comments
 (0)