Skip to content

Commit 2ac8194

Browse files
authored
fix: Bugs from testing (#8911)
* Fix underlay height during animation * Fix tray animation speed * Fix position of arrows in react-aria homepage * Fix scrollbars appearing in Firefox when a dialog opens * Fix SegmentedControl off by 1px in Safari * Fix alignment of Disclosure example in RAC docs
1 parent a0e8ea0 commit 2ac8194

File tree

6 files changed

+24
-23
lines changed

6 files changed

+24
-23
lines changed

packages/@adobe/spectrum-css-temp/components/tray/index.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
border-radius: var(--spectrum-tray-full-width-border-radius) var(--spectrum-tray-full-width-border-radius) var(--spectrum-tray-border-radius) var(--spectrum-tray-border-radius);
7171

7272
/* Start offset by the animation distance */
73-
transform: translateY(100%);
73+
transform: translateY(calc(100% - 100vh));
7474

7575
/* Exit animations */
7676
transition: opacity var(--spectrum-dialog-exit-animation-duration) cubic-bezier(0.5, 0, 1, 1) var(--spectrum-dialog-exit-animation-delay),

packages/@react-spectrum/overlays/src/Underlay.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function Underlay({isOpen, isTransparent, ...otherProps}: UnderlayProps):
2525
data-testid="underlay"
2626
{...otherProps}
2727
// Cover the entire document so iOS 26 Safari doesn't clip the underlay to the inner viewport.
28-
style={{height: isOpen && typeof document !== 'undefined' ? document.body.clientHeight : undefined}}
28+
style={{height: typeof document !== 'undefined' ? document.body.getBoundingClientRect().height : undefined}}
2929
className={classNames(underlayStyles, 'spectrum-Underlay', {
3030
'is-open': isOpen,
3131
'spectrum-Underlay--transparent': isTransparent

packages/@react-spectrum/s2/src/SegmentedControl.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ const slider = style<{isDisabled: boolean}>({
110110
isDisabled: 'GrayText'
111111
}
112112
},
113+
top: 0,
113114
left: 0,
114115
width: 'full',
115116
height: 'full',

packages/dev/docs/pages/react-aria/home/ExampleApp.tsx

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -510,30 +510,30 @@ function PlantModal(props: ModalOverlayProps) {
510510
${isExiting ? 'animate-out fade-out duration-200 ease-in' : ''}
511511
`}>
512512
{({isEntering, isExiting}) => (<>
513-
{!isResized &&
514-
<div
515-
data-react-aria-top-layer="true"
516-
className={`fixed top-0 left-0 w-full h-(--visual-viewport-height) z-30 hidden sm:flex items-center justify-center pointer-events-none [filter:drop-shadow(0_0_3px_white)] dark:filter-none
517-
${isEntering ? 'animate-in zoom-in-105 ease-out duration-200' : ''}
518-
${isExiting ? 'animate-out zoom-out-95 ease-in duration-200' : ''}
519-
`}>
520-
<svg viewBox="0 0 700 620" width={700} height={620}>
521-
<Arrow textX={52} x1={88} x2={130} y={50} href="Dialog.html">Dialog</Arrow>
522-
<Arrow textX={34} x1={88} x2={150} y={150} href="DropZone.html">DropZone</Arrow>
523-
<Arrow textX={54} x1={88} x2={150} y={272} href="Select.html">Select</Arrow>
524-
<Arrow textX={32} x1={88} x2={150} y={492} href="DatePicker.html">DatePicker</Arrow>
525-
<Arrow textX={616} x1={550} x2={612} y={126} marker="markerStart" href="ComboBox.html">ComboBox</Arrow>
526-
<Arrow textX={616} x1={550} x2={612} y={198} marker="markerStart" href="TextField.html">TextField</Arrow>
527-
<Arrow points="560,90 590,90 590,338 612,338 590,338 590,585 560,585" textX={616} y={338} marker="none" href="Form.html">Form</Arrow>
528-
</svg>
529-
</div>
530-
}
531513
{/* Inner position: sticky div sized to the visual viewport
532514
height so the modal appears in view.
533515
Note that position: fixed will not work here because this
534516
is positioned relative to the containing block, which is
535517
the ModalOverlay in this case due to backdrop-blur. */}
536518
<div className="sticky top-0 left-0 w-full h-(--visual-viewport-height) flex items-center justify-center p-4 text-center">
519+
{!isResized &&
520+
<div
521+
data-react-aria-top-layer="true"
522+
className={`absolute top-0 left-0 w-full h-(--visual-viewport-height) z-30 hidden sm:flex items-center justify-center pointer-events-none [filter:drop-shadow(0_0_3px_white)] dark:filter-none
523+
${isEntering ? 'animate-in zoom-in-105 ease-out duration-200' : ''}
524+
${isExiting ? 'animate-out zoom-out-95 ease-in duration-200' : ''}
525+
`}>
526+
<svg viewBox="0 0 700 620" width={700} height={620}>
527+
<Arrow textX={52} x1={88} x2={130} y={50} href="Dialog.html">Dialog</Arrow>
528+
<Arrow textX={34} x1={88} x2={150} y={150} href="DropZone.html">DropZone</Arrow>
529+
<Arrow textX={54} x1={88} x2={150} y={272} href="Select.html">Select</Arrow>
530+
<Arrow textX={32} x1={88} x2={150} y={492} href="DatePicker.html">DatePicker</Arrow>
531+
<Arrow textX={616} x1={550} x2={612} y={126} marker="markerStart" href="ComboBox.html">ComboBox</Arrow>
532+
<Arrow textX={616} x1={550} x2={612} y={198} marker="markerStart" href="TextField.html">TextField</Arrow>
533+
<Arrow points="560,90 590,90 590,338 612,338 590,338 590,585 560,585" textX={616} y={338} marker="none" href="Form.html">Form</Arrow>
534+
</svg>
535+
</div>
536+
}
537537
<RACModal
538538
{...props}
539539
ref={ref}

packages/react-aria-components/docs/Disclosure.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ import {ChevronRight} from 'lucide-react';
8686
}
8787

8888
.react-aria-Heading {
89-
margin-bottom: 0;
89+
margin: 0;
9090
}
9191

9292
&[data-expanded] .react-aria-Button[slot=trigger] svg {
@@ -211,7 +211,7 @@ In some use cases, you may want to add an interactive element, like a button, ad
211211

212212
```tsx example
213213
<Disclosure>
214-
<div style={{display: 'flex', alignItems: 'center'}}>
214+
<div style={{display: 'flex', alignItems: 'center', gap: 16}}>
215215
<Heading>
216216
<Button slot="trigger">
217217
<ChevronRight size={18} />

packages/react-aria-components/src/Modal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ function ModalOverlayInner({UNSTABLE_portalContainer, ...props}: ModalOverlayInn
174174
let style = {
175175
...renderProps.style,
176176
'--visual-viewport-height': viewport.height + 'px',
177-
'--page-height': typeof document !== 'undefined' ? document.body.clientHeight + 'px' : undefined
177+
'--page-height': typeof document !== 'undefined' ? document.body.getBoundingClientRect().height + 'px' : undefined
178178
};
179179

180180
return (

0 commit comments

Comments
 (0)