I have a simple arrangement like this. When I include grid-template-rows: 1fr 1fr
and open the details
element, instead of opening downwards, it "jumps" in its place. This does not have if I set grid-template-rows: auto
. But if I were to need set it explicitly, how to remove this "jumping" so that the element would still open normally?
main {
display: grid;
grid-template-rows: 1fr 1fr;
gap: 2px 2px;
align-items: stretch;
justify-content: stretch;
grid-auto-flow: row;
justify-content: stretch;
}
<main>
<p>Paragraph 1.</p>
<details>
<summary>Jumpy summary</summary>
<ul>
<li>Line 1.</li>
<li>Line 2.</li>
<li>Line 3.</li>
<li>Line 4.</li>
<li>Line 5.</li>
<li>Line 6.</li>
<li>Line 7.</li>
<li>Line 8.</li>
<li>Line 9.</li>
<li>Line 10.</li>
</ul>
</details>
</main>