<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0" -->

---
title: Four of our pages scrolled sideways on a phone. Two...
description: A sweep of 23 pages checking documentElement.scrollWidth against clientWidth at five viewport widths found four pages scrolling sideways on mobile, one by as...
canonical: https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Four of our pages scrolled sideways on a phone. Two already had overflow-x-auto on the right element. | daily.dev
og:description: A sweep of 23 pages checking documentElement.scrollWidth against clientWidth at five viewport widths found four pages scrolling sideways on mobile, one by as...
og:url: https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0
og:image: https://api.daily.dev/og/posts/gGTQvACq0.png
og:image:alt: Four of our pages scrolled sideways on a phone. Two already had overflow-x-auto on the right element.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Four of our pages scrolled sideways on a phone. Two already had overflow-x-auto on the right element.

**[AlphAI](https://daily.dev/sources/alphai)** · [@mikhailmakeev](https://daily.dev/mikhailmakeev) · 2 min read · 4 upvotes · 2 comments

## Summary

A sweep of 23 pages checking documentElement.scrollWidth against clientWidth at five viewport widths found four pages scrolling sideways on mobile, one by as much as 86px on a 390px-wide phone. The root cause was consistently grid or flex children defaulting to min-width: auto, preventing shrinkage; culprits included a fixed-width TradingView iframe, code blocks without min-w-0, an unbreakable 319px monospace string, and even a single 208px word at text-3xl. Fixes were mostly adding min-w-0 to grid children and break-words to unbreakable tokens. The reusable takeaway is a one-line console check (scrollWidth minus clientWidth) run at 360px and 390px widths to catch horizontal overflow that desktop-width design reviews would miss.

## Content

We swept `documentElement.scrollWidth` against `clientWidth` across 23 pages at five widths, and four came back broken. The worst was an article page 86px wider than a 390px phone.

All four were the same class. A grid or flex child defaults to `min-width: auto`, so it can't shrink below its content, and one un-shrinkable thing sets the track width for the whole row. That's also why the `overflow-x-auto` didn't save us in two of them. The scroll container was on the right element, but an ancestor had no `min-w-0`. The ancestor grew instead of the container scrolling.

What was actually un-shrinkable, case by case:

- a TradingView mini-chart that renders a 443px iframe no matter what `width="100%"` says
- code blocks sitting in grid cells with no `min-w-0`
- a 319px run of unbreakable monospace in an API route name
- one word. "Cryptocurrency" is 208px at `text-3xl`, in a 143px track

The fixes were dull, mostly `min-w-0` on the grid children and `break-words` on the unbreakable tokens.

The part worth stealing is the check. Paste this in the console at 360 and again at 390:

```javascript
document.documentElement.scrollWidth - document.documentElement.clientWidth
```

Anything over 0 is a page that scrolls sideways on a phone. We had shipped four of them without noticing, and reviewing the designs at desktop width would not have caught a single one.

## Community discussion

Top comments from developers on daily.dev.

**@agustinbarrientos** · 2 upvotes

> I'd put that zero-width check in the mobile smoke test too. Screenshots don't always catch a page drifting sideways.

## Similar posts on daily.dev

- [Using 100vw is now scrollbar-aware \(in Chrome 145\+, under the right conditions\)](https://daily.dev/posts/using-100vw-is-now-scrollbar-aware-in-chrome-145-under-the-right-conditions--52isi4cnv) · Bram.us · 0 upvotes · 0 comments
- [Easy \(Horizontal Scrollbar\) Fixes for Your Blog CSS](https://daily.dev/posts/easy-horizontal-scrollbar-fixes-for-your-blog-css-ubbxxwe5v) · Lobsters · 3 upvotes · 0 comments
- [The root scroller and how not to lose it](https://daily.dev/posts/the-root-scroller-and-how-not-to-lose-it-ujk7eemn1) · Polypane · 1 upvotes · 0 comments
- [How I Lost MadCSS – Frontend Masters Blog](https://daily.dev/posts/how-i-lost-madcss-frontend-masters-blog-pphmrhzaq) · Frontend Masters · 66 upvotes · 2 comments

---

Tags: [#css](https://daily.dev/tags/css), [#ui-design](https://daily.dev/tags/ui-design), [#tailwind-css](https://daily.dev/tags/tailwind-css)

[View this post on daily.dev](https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"DiscussionForumPosting","mainEntityOfPage":"https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0","headline":"Four of our pages scrolled sideways on a phone. Two already had overflow-x-auto on the right element.","text":"A sweep of 23 pages checking documentElement.scrollWidth against clientWidth at five viewport widths found four pages scrolling sideways on mobile, one by as much as 86px on a 390px-wide phone. The root cause was consistently grid or flex children defaulting to min-width: auto, preventing shrinkage; culprits included a fixed-width TradingView iframe, code blocks without min-w-0, an unbreakable 319px monospace string, and even a single 208px word at text-3xl. Fixes were mostly adding min-w-0 to grid children and break-words to unbreakable tokens. The reusable takeaway is a one-line console check (scrollWidth minus clientWidth) run at 360px and 390px widths to catch horizontal overflow that desktop-width design reviews would miss.","url":"https://daily.dev/posts/four-of-our-pages-scrolled-sideways-on-a-phone-two-already-had-overflow-x-auto-on-the-right-element-ggtqvacq0","datePublished":"2026-09-10T04:46:48.171Z","dateModified":"2026-10-11T17:52:22.036Z","author":{"@type":"Person","name":"Mikhail Makeev","url":"https://daily.dev/mikhailmakeev","image":"https://lh3.googleusercontent.com/a/ACg8ocIjcvDU1gmJ9-KJDeTYqY2rMdl5QxcWYtLTGSXrj8ubF4nwar_w=s96-c","description":"Owner of alphai.io","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":5450}},"image":"https://media.daily.dev/image/upload/s--2xPwUKrH--/f_auto/v1789276638/posts/gGTQvACq0?_a=BAMAMicg0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":4},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":2}],"comment":[{"@type":"Comment","text":"I’d put that zero-width check in the mobile smoke test too. Screenshots don’t always catch a page drifting sideways.","datePublished":"2026-09-19T14:51:25.432Z","url":"https://daily.dev/posts/gGTQvACq0#c-9MTdf7nBH","author":{"@type":"Person","name":"Agustin Barrientos","url":"https://daily.dev/agustinbarrientos","image":"https://media.daily.dev/image/upload/s--5ayxQnqn--/f_auto/v1788281802/avatars/avatar_wQYYVe5Tbj0NJ7C7qPoa8?_a=BAMAMicg0"},"interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2}}],"isPartOf":{"@type":"WebPage","url":"https://daily.dev/squads/alphai","name":"AlphAI"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AlphAI","item":"https://daily.dev/squads/alphai"},{"@type":"ListItem","position":3,"name":"Four of our pages scrolled sideways on a phone. Two already had overflow-x-auto on the right element."}]}
```

