A couple of projects I’ve been working on lately have triggered a frustrating overflow bug that took me ages to find the cause of. Sometimes a horizontal scrollbar would appear for no obvious reason.
I first noticed it in narrow mobile viewports when testing changing the orientation from landscape to portrait in the iOS Simulator, which made me think that it happened only in iOS WebKit. However when I made a minimal test case to try to isolate the problem it turned out that it happens in WebKit-based desktop browsers like Safari, Chrome, and iCab as well. I haven’t been able to reproduce it in any other browsers though.
After a lot of testing I found the culprit, and it was a quite unexpected one to me.
Copyright © Roger Johansson