Skip to content

Commit 9e79420

Browse files
authored
Fix CardView quiet heights in Safari (#7046)
1 parent 2ca5989 commit 9e79420

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ let card = style({
114114
quiet: 'visible'
115115
}
116116
},
117+
contain: 'layout',
117118
disableTapHighlight: true,
118119
userSelect: {
119120
isCardView: 'none'

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,11 +551,13 @@ function CardView<T extends object>(props: CardViewProps<T>, ref: DOMRef<HTMLDiv
551551
items: props.items, // TODO: ideally this would be the collection. items won't exist for static collections, or those using <Collection>
552552
onLoadMore: props.onLoadMore
553553
}, domRef);
554+
555+
let ctx = useMemo(() => ({size, variant}), [size, variant]);
554556

555557
return (
556558
<UNSTABLE_Virtualizer layout={layout} layoutOptions={options}>
557559
<CardViewContext.Provider value={GridListItem}>
558-
<CardContext.Provider value={{size, variant}}>
560+
<CardContext.Provider value={ctx}>
559561
<ImageCoordinator>
560562
<AriaGridList
561563
ref={domRef}

0 commit comments

Comments
 (0)