iftechfoundation / ifdb

The software behind the Interactive Fiction Database (IFDB)
Other
23 stars 18 forks source link

Fix float-clearing bug #332

Closed dfabulich closed 3 weeks ago

dfabulich commented 3 weeks ago

Fixes https://github.com/iftechfoundation/ifdb/issues/388

In iftechfoundation/ifdb#548, I removed what I thought was an "unnecessary" table, with just one row and one cell.

But the table did serve a purpose that I didn't realize at the time: it created a block formatting context.

When the externalLinksDiv went to clear: both, when the table was there, it would only clear the coverart, but when we removed the table, it would also attempt to clear the External Links div, which could be arbitrarily long, creating a huge empty space on the page.

Adding display: flow-root to the mainSummary fixes the issue.

I've tested this on Counterfeit Monkey, Anchorhead, Uninteractive Fiction, and Cold Iron.

I missed this in iftechfoundation/ifdb#548 because I'd only tested Uninteractive Fiction and Counterfeit Monkey, but CM doesn't have a Website and so it didn't have an externalLinksDiv on desktop screen sizes, so it didn't trigger this bug. Anchorhead does, and so does Cold Iron (which is the case where the bug was first reported to me).

This bug is so bad that I think I'm going to merge the fix without review, but I invite you to take a look after the fact!

erkyrath commented 3 weeks ago

Looks right at a quick glance. (display: flow-root is one of my favorite recent discoveries!)