Skip to content

Commit be73693

Browse files
CopilotHotelllayershifter
authored
fix(react-dialog): DialogSurface height respects custom maxHeight styles (#34881)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Hotell <1223799+Hotell@users.noreply.github.com> Co-authored-by: layershifter <14183168+layershifter@users.noreply.github.com>
1 parent b039193 commit be73693

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "patch",
3+
"comment": "fix: DialogSurface and DialogBody height respects custom maxHeight styles by replacing @supports rules with Griffel fallback arrays",
4+
"packageName": "@fluentui/react-dialog",
5+
"email": "198982749+Copilot@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/react-components/react-dialog/library/src/components/DialogBody/useDialogBodyStyles.styles.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@ const useResetStyles = makeResetStyles({
1414
overflow: 'unset',
1515
gap: DIALOG_GAP,
1616
display: 'grid',
17-
maxHeight: `calc(100vh - 2 * ${SURFACE_PADDING})`,
17+
maxHeight: [`calc(100vh - 2 * ${SURFACE_PADDING})`, `calc(100dvh - 2 * ${SURFACE_PADDING})`],
1818
boxSizing: 'border-box',
1919
gridTemplateRows: 'auto 1fr',
2020
gridTemplateColumns: '1fr 1fr auto',
2121

22-
'@supports (height: 1dvh)': {
23-
maxHeight: `calc(100dvh - 2 * ${SURFACE_PADDING})`,
24-
},
25-
2622
[MEDIA_QUERY_BREAKPOINT_SELECTOR]: {
2723
maxWidth: '100vw',
2824
gridTemplateRows: 'auto 1fr auto',

packages/react-components/react-dialog/library/src/components/DialogSurface/useDialogSurfaceStyles.styles.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,14 @@ const useRootBaseStyle = makeResetStyles({
3535
position: 'fixed',
3636
height: 'fit-content',
3737
maxWidth: '600px',
38-
maxHeight: '100vh',
38+
maxHeight: ['100vh', '100dvh'],
3939
boxSizing: 'border-box',
4040
backgroundColor: tokens.colorNeutralBackground1,
4141
color: tokens.colorNeutralForeground1,
4242
// Same styles as DialogSurfaceMotion last keyframe,
4343
// to ensure dialog will be properly styled when surfaceMotion is opted-out
4444
boxShadow: tokens.shadow64,
4545

46-
'@supports (height: 1dvh)': {
47-
maxHeight: '100dvh',
48-
},
49-
5046
[MEDIA_QUERY_BREAKPOINT_SELECTOR]: {
5147
maxWidth: '100vw',
5248
},

0 commit comments

Comments
 (0)