adobe / react-spectrum

A collection of libraries and tools that help you build adaptive, accessible, and robust user experiences.
https://react-spectrum.adobe.com
Apache License 2.0
12.73k stars 1.09k forks source link

Fix CardView quiet heights in Safari #7046

Closed devongovett closed 1 week ago

devongovett commented 1 week ago

Fixes a bug found during testing where in Safari the heights of the cards would become massive, only in the quiet variant, and this could result in a "maximum update depth exceeded" crash. That resulted from the cards getting larger and larger each render, triggering more renders, etc.

I don't quite understand the reason this happened, only in Safari, but the difference between quiet and non-quiet cards that seemed to cause it was overflow: visible vs overflow: clip. We need visible so the shadow on the preview shows. Adding contain: layout seems to fix this, but again, still not sure why exactly. I also noticed that the issue is fixed in Safari Tech Preview, even without this change. 🤷

rspbot commented 1 week ago

Build successful! 🎉