I have a horizontally scrollable list of cards, and a toggle button which removes/adds the cards from the container. When the cards are removed, the container becomes an div with no children. On Safari, clicking the button to remove the cards removes the children, but the container retains its original dimensions. Furthermore, the label from the button disappears (possibly a completely unrelated bug). A repro case is here: https://vvugb.csb.app. Click the button and observe how the container doesn't shrink vertically. The <hr> is placed after the container, so it should move up, but doesn't. Clicking the button again to show the cards doesn't work anymore, the cards are inserted into the DOM but not rendered. You can see the code here: https://codesandbox.io/s/peaceful-morning-vvugb?file=/src/App.tsx. A couple notes: - If I remove overflowX:auto from the container, the bug disappears. - If I remove the card with the longest name ({ name: "Excepteur sint occaecat cupidatat non proident" }), the bug disappears (possibly bug is present whenever the text wraps to multiple lines?) - Resizing the viewport fixes the bug temporarily (I guess because it triggers a layout/render of the whole viewport).
Does this happen when not using grid layout?
@smfr, no, if I change display:grid to display:flex on line 15 (the display of the card container), then the bug disappears.
<rdar://problem/76835522>