diff --git a/packages/@react-spectrum/s2/src/Toast.tsx b/packages/@react-spectrum/s2/src/Toast.tsx index 0507726bcb4..4d93d206987 100644 --- a/packages/@react-spectrum/s2/src/Toast.tsx +++ b/packages/@react-spectrum/s2/src/Toast.tsx @@ -179,7 +179,12 @@ const toastRegion = style({ bottom: { placement: { bottom: { - default: 16, + // On mobile, when the on-screen keyboard is open the dynamic viewport + // (dvh) shrinks while the layout viewport (vh) stays the same. + // calc(100vh - 100dvh + 16px) equals the keyboard height + 16px, + // keeping the toast above the keyboard on any browser that supports dvh. + // On desktop (no keyboard) 100vh === 100dvh so this reduces to 16px. + default: '[calc(100vh - 100dvh + 16px)]', isExpanded: 0 } }