Skip to content

Commit 96b21f2

Browse files
authored
Fix dialog entry animations and size (#11565)
- Stop resizing when `Dialog`s first render - Fix `Dialog type="fullscreen"`s being smaller than before - Check the "Discover" button in the top left to see a fullscreen modal. # Important Notes None
1 parent 59493c9 commit 96b21f2

File tree

1 file changed

+6
-2
lines changed
  • app/gui/src/dashboard/components/AriaComponents/Dialog

1 file changed

+6
-2
lines changed

app/gui/src/dashboard/components/AriaComponents/Dialog/Dialog.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ const DIALOG_STYLES = tv({
6161
modal: {
6262
base: 'w-full min-h-[100px] max-h-[90vh]',
6363
header: 'px-3.5 pt-[3px] pb-0.5 min-h-[42px]',
64+
measuredContent: 'max-h-[90vh]',
6465
},
6566
fullscreen: {
6667
base: 'w-full h-full max-w-full max-h-full bg-clip-border',
6768
header: 'px-4 pt-[5px] pb-1.5 min-h-12',
69+
measuredContent: 'max-h-[100vh]',
6870
},
6971
},
7072
fitContent: {
@@ -124,7 +126,7 @@ const DIALOG_STYLES = tv({
124126
closeButton: 'col-start-1 col-end-1 mr-auto',
125127
heading: 'col-start-2 col-end-2 my-0 text-center',
126128
content: 'relative flex-auto overflow-y-auto max-h-[inherit]',
127-
measuredContent: 'flex flex-col max-h-[90vh]',
129+
measuredContent: 'flex flex-col',
128130
},
129131
compoundVariants: [
130132
{ type: 'modal', size: 'small', class: 'max-w-sm' },
@@ -207,7 +209,9 @@ export function Dialog(props: DialogProps) {
207209
const dialogLayoutId = `dialog-${dialogId}`
208210
const titleId = `${dialogId}-title`
209211

210-
const [contentDimensionsRef, { width: dialogWidth, height: dialogHeight }] = useDimensions()
212+
const [contentDimensionsRef, dimensions] = useDimensions()
213+
const dialogWidth = dimensions.width || '100%'
214+
const dialogHeight = dimensions.height || '100%'
211215
const dialogRef = React.useRef<HTMLDivElement>(null)
212216
const overlayState = React.useRef<aria.OverlayTriggerState | null>(null)
213217
const root = portal.useStrictPortalContext()

0 commit comments

Comments
 (0)